Make use of new str.startswith/endswith semantics.

Occurences in email and compiler were ignored due to backwards compat requirements.
This commit is contained in:
Georg Brandl 2006-06-09 20:43:48 +00:00
parent 3ebef999e6
commit b2afe855e5
11 changed files with 14 additions and 20 deletions

View file

@ -46,7 +46,7 @@ def warn(message, category=None, stacklevel=1):
filename = globals.get('__file__')
if filename:
fnl = filename.lower()
if fnl.endswith(".pyc") or fnl.endswith(".pyo"):
if fnl.endswith((".pyc", ".pyo")):
filename = filename[:-1]
else:
if module == "__main__":