Skip to content

Commit

Permalink
Error class stores status in strings
Browse files Browse the repository at this point in the history
but setResponseCode wants an int.
tw16 started to enforce Error's status  to be string, while before we always sent an int.
  • Loading branch information
tardyp committed Aug 17, 2016
1 parent 4e6c6de commit 4700668
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions master/buildbot/test/util/www.py
Expand Up @@ -78,6 +78,8 @@ def finish(self):
self.deferred.callback(self.written)

def setResponseCode(self, code):
# twisted > 16 started to assert this
assert isinstance(code, (int, long))
self.responseCode = code

def setHeader(self, hdr, value):
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/www/resource.py
Expand Up @@ -84,7 +84,7 @@ def failHttpRedirect(f):
def failHttpError(f):
f.trap(Error)
e = f.value
writeError(e.message, errcode=e.status)
writeError(e.message, errcode=int(e.status))

@d.addErrback
def fail(f):
Expand Down

0 comments on commit 4700668

Please sign in to comment.