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/http.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/http.py')
-rw-r--r-- | rpki/http.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rpki/http.py b/rpki/http.py index 7127bbde..2d53511b 100644 --- a/rpki/http.py +++ b/rpki/http.py @@ -203,7 +203,7 @@ class http_message(object): Parse HTTP version, raise an exception if we can't. """ if version[:5] != "HTTP/": - raise rpki.exceptions.HTTPBadVersion, "Couldn't parse version %s" % version + raise rpki.exceptions.HTTPBadVersion("Couldn't parse version %s" % version) self.version = tuple(int(i) for i in version[5:].split(".")) @property @@ -748,7 +748,7 @@ class http_client(http_stream): assert not self.msg.body self.logger.debug("Ignoring empty response received while closing") return - raise rpki.exceptions.HTTPUnexpectedState, "%r received message while in unexpected state %s" % (self, self.state) + raise rpki.exceptions.HTTPUnexpectedState("%r received message while in unexpected state %s" % (self, self.state)) if self.expect_close: self.logger.debug("Closing") @@ -782,7 +782,7 @@ class http_client(http_stream): if self.get_terminator() is None: self.handle_body() elif self.state == "request-sent": - raise rpki.exceptions.HTTPClientAborted, "HTTP request aborted by close event" + raise rpki.exceptions.HTTPClientAborted("HTTP request aborted by close event") else: self.queue.detach(self) @@ -944,7 +944,7 @@ def client(msg, url, callback, errback): u.params != "" or u.query != "" or u.fragment != ""): - raise rpki.exceptions.BadClientURL, "Unusable URL %s" % url + raise rpki.exceptions.BadClientURL("Unusable URL %s" % url) if debug_http: logger.debug("Contacting %s" % url) |