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/cacheview/forms.py | |
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/cacheview/forms.py')
-rw-r--r-- | rpki/gui/cacheview/forms.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rpki/gui/cacheview/forms.py b/rpki/gui/cacheview/forms.py index 28b8ff24..7ae3601f 100644 --- a/rpki/gui/cacheview/forms.py +++ b/rpki/gui/cacheview/forms.py @@ -30,19 +30,19 @@ class SearchForm(forms.Form): asn = self.cleaned_data.get('asn') addr = self.cleaned_data.get('addr') if (asn and addr) or ((not asn) and (not addr)): - raise forms.ValidationError, 'Please specify either an AS or IP range, not both' + raise forms.ValidationError('Please specify either an AS or IP range, not both') if asn: try: resource_range_as.parse_str(asn) except ValueError: - raise forms.ValidationError, 'invalid AS range' + raise forms.ValidationError('invalid AS range') if addr: #try: parse_ipaddr(addr) #except BadIPResource: - # raise forms.ValidationError, 'invalid IP address range/prefix' + # raise forms.ValidationError('invalid IP address range/prefix') return self.cleaned_data |