diff options
author | Raymond Hettinger <python@rcn.com> | 2014-05-13 05:22:46 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-05-13 05:22:46 (GMT) |
commit | 38acd4c028f72a80079c27d68c8da2efd059a38d (patch) | |
tree | 61ce3c9da3d1cb1d65f8a0aa9e96a92e8c4b11cf /Lib/urllib | |
parent | 51669d8c188dad5b4e9fc071e5d2e8f8cde9ed37 (diff) | |
download | cpython-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.py | 2 |
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: |