summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSviatoslav Sydorenko <wk@sydorenko.org.ua>2016-02-28 10:56:30 +0200
committerSviatoslav Sydorenko <wk@sydorenko.org.ua>2016-02-28 10:56:30 +0200
commitf4b2cb0297f4f07d27f142e9112bd5fbf6a0a2c6 (patch)
treeefce3731deb1e76f89e47dc23d9cbc782120a6bd
parent4557f52729e4e7f5b03c876bcb476de3b8cdc706 (diff)
downloadroutes-f4b2cb0297f4f07d27f142e9112bd5fbf6a0a2c6.tar.gz
Wrap conditions with parentheses
-rw-r--r--routes/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/routes/util.py b/routes/util.py
index 24eb3e1..f3d2dc4 100644
--- a/routes/util.py
+++ b/routes/util.py
@@ -258,7 +258,7 @@ def url_for(*args, **kargs):
url = config.mapper.generate(*route_args, **newargs)
if anchor is not None:
url += '#' + _url_quote(anchor, encoding)
- if host or protocol is not None or qualified:
+ if host or (protocol is not None) or qualified:
if not host and not qualified:
# Ensure we don't use a specific port, as changing the protocol
# means that we most likely need a new port
@@ -411,7 +411,7 @@ class URLGenerator(object):
url = self.mapper.generate(*route_args, **newargs)
if anchor is not None:
url += '#' + _url_quote(anchor, encoding)
- if host or protocol is not None or qualified:
+ if host or (protocol is not None) or qualified:
if 'routes.cached_hostinfo' not in self.environ:
cache_hostinfo(self.environ)
hostinfo = self.environ['routes.cached_hostinfo']