use six privided functions/classes to support py2/py3 in one source. refs #1350.

This commit is contained in:
Takayuki Shimizukawa
2014-04-29 19:59:58 +09:00
parent 68290a266c
commit c3c879f2c6
24 changed files with 79 additions and 80 deletions

View File

@@ -69,15 +69,11 @@ import sys
import atexit
import threading
import token
import types
import zipimport
from socket import gethostname
# Python version compatibility
try:
strclass = basestring # new to 2.3
except:
strclass = str
import six
# 2. IMPLEMENTATION
#
@@ -845,7 +841,7 @@ class coverage:
# On windows, the shell doesn't expand wildcards. Do it here.
globbed = []
for morf in morfs:
if isinstance(morf, strclass):
if isinstance(morf, six.string_types):
globbed.extend(glob.glob(morf))
else:
globbed.append(morf)