Convert old style except blocks to except Exception as variable: blocks
[htsworkflow.git] / experiments / experiments.py
index a5b8436df567ee7396a46abd9697fcb5c1557f79..b8f905ecf3682d0e59e340b4597c12a17fdc084d 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import, print_function
 from datetime import datetime, timedelta
 try:
     import json
-except ImportError, e:
+except ImportError as e:
     import simplejson as json
 
 import os
@@ -28,7 +28,7 @@ def flowcell_information(flowcell_id):
     """
     try:
         fc = FlowCell.objects.get(flowcell_id__startswith=flowcell_id)
-    except FlowCell.DoesNotExist, e:
+    except FlowCell.DoesNotExist as e:
         return None
 
     lane_set = {}
@@ -126,7 +126,7 @@ def lanes_for_json(request, username):
 
     try:
         result = lanes_for(username)
-    except ObjectDoesNotExist, e:
+    except ObjectDoesNotExist as e:
         raise Http404
 
     #convert query set to python structure