summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-05-13 05:22:46 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-05-13 05:22:46 (GMT)
commit38acd4c028f72a80079c27d68c8da2efd059a38d (patch)
tree61ce3c9da3d1cb1d65f8a0aa9e96a92e8c4b11cf /Lib/urllib
parent51669d8c188dad5b4e9fc071e5d2e8f8cde9ed37 (diff)
downloadcpython-38acd4c028f72a80079c27d68c8da2efd059a38d.zip
cpython-38acd4c028f72a80079c27d68c8da2efd059a38d.tar.gz
cpython-38acd4c028f72a80079c27d68c8da2efd059a38d.tar.bz2
Issue 21469: Minor code modernization (convert and/or expression to an if/else expression).
Suggested by: Tal Einat
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/robotparser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py
index 1d7b751..4fbb0cb 100644
--- a/Lib/urllib/robotparser.py
+++ b/Lib/urllib/robotparser.py
@@ -172,7 +172,7 @@ class RuleLine:
return self.path == "*" or filename.startswith(self.path)
def __str__(self):
- return (self.allowance and "Allow" or "Disallow") + ": " + self.path
+ return ("Allow" if self.allowance else "Disallow") + ": " + self.path
class Entry: