From 885c858288c880f538acba10376f28b9be584ce8 Mon Sep 17 00:00:00 2001 From: Charles Murphy Date: Tue, 7 Nov 2017 14:22:08 -0500 Subject: [PATCH] Exception handling for python 2 and 3 --- agfusion/cli.py | 6 +++--- agfusion/model.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agfusion/cli.py b/agfusion/cli.py index 46cb6f9..cfab5c6 100644 --- a/agfusion/cli.py +++ b/agfusion/cli.py @@ -169,11 +169,11 @@ def batch_mode(args, agfusion_db, pyensembl_data, rename, colors): scale=None, batch_out_dir=args.out ) - except exceptions.GeneIDException, e: + except exceptions.GeneIDException as e: agfusion_db.logger.error(e) - except exceptions.JunctionException, e: + except exceptions.JunctionException as e: agfusion_db.logger.error(e) - except exceptions.TooManyGenesException, e: + except exceptions.TooManyGenesException as e: agfusion_db.logger.error(e) else: agfusion_db.logger.error( diff --git a/agfusion/model.py b/agfusion/model.py index 97dbd49..c070dd3 100644 --- a/agfusion/model.py +++ b/agfusion/model.py @@ -39,7 +39,7 @@ def __init__(self, genes=None, junction=0, pyensembl_data=None, """ if type(genes)==str: - genes = list(genes) + genes = [genes] elif type(genes)!=list: db.logger.error( 'parameter \'gene\' to _Gene is not string or list: {}'