summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'coverage')
-rw-r--r--coverage/codeunit.py2
-rw-r--r--coverage/execfile.py2
-rw-r--r--coverage/files.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py
index ca1ae5c5..c58e237b 100644
--- a/coverage/codeunit.py
+++ b/coverage/codeunit.py
@@ -52,7 +52,7 @@ class CodeUnit(object):
else:
f = morf
# .pyc files should always refer to a .py instead.
- if f.endswith('.pyc') or f.endswith('.pyo'):
+ if f.endswith(('.pyc', '.pyo')):
f = f[:-1]
elif f.endswith('$py.class'): # Jython
f = f[:-9] + ".py"
diff --git a/coverage/execfile.py b/coverage/execfile.py
index f6ebdf79..5d4ae690 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -94,7 +94,7 @@ def run_python_file(filename, args, package=None):
try:
# Make a code object somehow.
- if filename.endswith(".pyc") or filename.endswith(".pyo"):
+ if filename.endswith((".pyc", ".pyo")):
code = make_code_from_pyc(filename)
else:
code = make_code_from_py(filename)
diff --git a/coverage/files.py b/coverage/files.py
index 464535a8..94388f96 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -137,7 +137,7 @@ def prep_patterns(patterns):
"""
prepped = []
for p in patterns or []:
- if p.startswith("*") or p.startswith("?"):
+ if p.startswith(("*", "?")):
prepped.append(p)
else:
prepped.append(abs_file(p))