diff options
author | Rob Austein <sra@hactrn.net> | 2014-05-29 19:33:43 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-05-29 19:33:43 +0000 |
commit | 07a045d1259f30878abba416b86373c05c929965 (patch) | |
tree | 9b8e4fe0038e4891e3b262168dce5ecfdccc36f7 /rpki/gui/app | |
parent | e6047c9f737275d898d88737719dd09a6ee4f25c (diff) |
Python style police: instantiate exceptions before raising them
(convert two-expression form of "raise" to one-expression form).
svn path=/trunk/; revision=5844
Diffstat (limited to 'rpki/gui/app')
-rw-r--r-- | rpki/gui/app/forms.py | 4 | ||||
-rw-r--r-- | rpki/gui/app/glue.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/rpki/gui/app/forms.py b/rpki/gui/app/forms.py index 20ce4a07..5394a804 100644 --- a/rpki/gui/app/forms.py +++ b/rpki/gui/app/forms.py @@ -257,8 +257,8 @@ class ROARequest(forms.Form): raise forms.ValidationError( 'max prefix length must be greater than or equal to the prefix length') if max_prefixlen > r.min.bits: - raise forms.ValidationError, \ - 'max prefix length (%d) is out of range for IP version (%d)' % (max_prefixlen, r.min.bits) + raise forms.ValidationError( + 'max prefix length (%d) is out of range for IP version (%d)' % (max_prefixlen, r.min.bits)) self.cleaned_data['max_prefixlen'] = str(max_prefixlen) return self.cleaned_data diff --git a/rpki/gui/app/glue.py b/rpki/gui/app/glue.py index b05e8f0d..0bf5f942 100644 --- a/rpki/gui/app/glue.py +++ b/rpki/gui/app/glue.py @@ -102,7 +102,7 @@ def list_received_resources(log, conf): if isinstance(pdu, report_error_elt): # this will cause the db to be rolled back so the above delete() # won't clobber existing resources - raise LeftRightError, pdu + raise LeftRightError(pdu) elif isinstance(pdu, list_received_resources_elt): if pdu.parent_handle != conf.handle: parent = models.Parent.objects.get(issuer=conf, |