From 38acd4c028f72a80079c27d68c8da2efd059a38d Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 12 May 2014 22:22:46 -0700 Subject: Issue 21469: Minor code modernization (convert and/or expression to an if/else expression). Suggested by: Tal Einat --- Lib/urllib/robotparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v0.12