mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use six privided functions/classes to support py2/py3 in one source. refs #1350.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user