Skip to content

Commit

Permalink
Exception handling for python 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
murphycj committed Nov 7, 2017
1 parent d9a10ca commit 885c858
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions agfusion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion agfusion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}'
Expand Down

0 comments on commit 885c858

Please sign in to comment.