Skip to content

Commit

Permalink
Merge pull request #78 from tardyp/py3fix
Browse files Browse the repository at this point in the history
Fix api resource for python3
  • Loading branch information
tardyp authored Jan 5, 2018
2 parents 07fc624 + 5c5d8ee commit 4b42adc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildbot_travis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# create the interface for the setuptools entry point
ep = Application(__name__, "Buildbot travis custom ui")
api = Api(ep)
ep.resource.putChild("api", api.app.resource())
ep.resource.putChild(b"api", api.app.resource())


__all__ = ['TravisConfigurator', 'ep']
2 changes: 1 addition & 1 deletion buildbot_travis/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def saveCfg(self, cfg):
@defer.inlineCallbacks
def assertAllowed(self, request):
try:
yield self.ep.master.www.assertUserAllowed(request, tuple(request.path.strip("/").split("/")),
yield self.ep.master.www.assertUserAllowed(request, tuple(request.path.strip(b"/").split(b"/")),
request.method, {})
except Forbidden:
request.setResponseCode(401)
Expand Down
2 changes: 1 addition & 1 deletion buildbot_travis/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, **kwargs):
EndpointMatcherBase.__init__(self, **kwargs)

def match(self, ep, action="get", options=None):
if "/".join(ep).startswith("buildbot_travis/api/config"):
if b"/".join(ep).startswith(b"buildbot_travis/api/config"):
return defer.succeed(Match(self.master))
return defer.succeed(None)

Expand Down

0 comments on commit 4b42adc

Please sign in to comment.