summaryrefslogtreecommitdiff
path: root/coverage/codeunit.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-09-22 07:22:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-09-22 07:22:56 -0400
commitd18c4a8ca50361893eaa7ba86821a136ba7a4807 (patch)
treed5b682a46e9b44a6edd6e12771ffc831503cb594 /coverage/codeunit.py
parentcfdd8b9c6c9a0fc0bb0d332dd034330a37ea5a1f (diff)
downloadpython-coveragepy-d18c4a8ca50361893eaa7ba86821a136ba7a4807.tar.gz
The best way to get py3k support: same source runs on both, with some contortions.
Diffstat (limited to 'coverage/codeunit.py')
-rw-r--r--coverage/codeunit.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py
index 7f4ed96..53c98fc 100644
--- a/coverage/codeunit.py
+++ b/coverage/codeunit.py
@@ -2,6 +2,9 @@
import glob, os
+from coverage.backward import string_class
+
+
def code_unit_factory(morfs, file_locator, omit_prefixes=None):
"""Construct a list of CodeUnits from polymorphic inputs.
@@ -21,7 +24,7 @@ def code_unit_factory(morfs, file_locator, omit_prefixes=None):
# On Windows, the shell doesn't expand wildcards. Do it here.
globbed = []
for morf in morfs:
- if isinstance(morf, basestring) and ('?' in morf or '*' in morf):
+ if isinstance(morf, string_class) and ('?' in morf or '*' in morf):
globbed.extend(glob.glob(morf))
else:
globbed.append(morf)