[Python-checkins] cpython: utilize startswith(tuple)

philip.jenvey python-checkins at python.org
Sun Apr 15 21:22:41 CEST 2012


http://hg.python.org/cpython/rev/1ca10eb58483
changeset: 76327:1ca10eb58483
parent: 76324:1a9252280f07
user: Philip Jenvey <pjenvey at underboss.org>
date: Sun Apr 15 12:21:32 2012 -0700
summary:
 utilize startswith(tuple)
files:
 Lib/importlib/_bootstrap.py | 4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -23,7 +23,7 @@
 
 
 def _make_relax_case():
- if any(map(sys.platform.startswith, CASE_INSENSITIVE_PLATFORMS)):
+ if sys.platform.startswith(CASE_INSENSITIVE_PLATFORMS):
 def _relax_case():
 """True if filenames must be checked case-insensitively."""
 return b'PYTHONCASEOK' in _os.environ
@@ -163,7 +163,7 @@
 def verbose_message(message, *args):
 """Print the message to stderr if -v/PYTHONVERBOSE is turned on."""
 if sys.flags.verbose:
- if not message.startswith('#') and not message.startswith('import '):
+ if not message.startswith(('#', 'import ')):
 message = '# ' + message
 print(message.format(*args), file=sys.stderr)
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /