From: Diane Trout Date: Fri, 20 Mar 2015 20:30:36 +0000 (-0700) Subject: update more raise exceptions to Exception(message) syntax X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=a1a90f858c4c5a2007014e65ab77890c617f6191 update more raise exceptions to Exception(message) syntax --- diff --git a/htsworkflow/pipelines/genome_mapper.py b/htsworkflow/pipelines/genome_mapper.py index fc70590..a080e57 100644 --- a/htsworkflow/pipelines/genome_mapper.py +++ b/htsworkflow/pipelines/genome_mapper.py @@ -60,7 +60,7 @@ def getAvailableGenomes(genome_base_dir): build_dict = d.setdefault(species, {}) if build in build_dict: msg = "Duplicate genome for %s|%s" % (species, build) - raise DuplicateGenome, msg + raise DuplicateGenome(msg) build_dict[build] = genome_dir diff --git a/inventory/views.py b/inventory/views.py index 23b7200..63f91a0 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -90,7 +90,7 @@ def getPrinterTemplateByType(item_type): printer_template = PrinterTemplate.objects.get(default=True) except ObjectDoesNotExist: msg = "No template for item type (%s) and no default template found" % (item_type.name) - raise ValueError, msg + raise ValueError(msg) return printer_template @@ -334,7 +334,7 @@ def link_flowcell_and_device(request, flowcell, serial): lts = None if count > 1: msg = "There really should only be one longtermstorage object per flowcell" - raise ValueError, msg + raise ValueError(msg) elif count == 1: # lts already attached to flowcell lts = fc.longtermstorage_set.all()[0]