mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
introduce the six module and reduce sphinx.util.pycompat implementation. refs #1350.
This commit is contained in:
@@ -12,6 +12,8 @@ import sys
|
||||
import shutil
|
||||
from codecs import open
|
||||
|
||||
import six
|
||||
|
||||
|
||||
FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
|
||||
@@ -20,7 +22,7 @@ class path(unicode):
|
||||
"""
|
||||
Represents a path which behaves like a string.
|
||||
"""
|
||||
if sys.version_info < (3, 0):
|
||||
if six.PY2:
|
||||
def __new__(cls, s, encoding=FILESYSTEMENCODING, errors='strict'):
|
||||
if isinstance(s, str):
|
||||
s = s.decode(encoding, errors)
|
||||
|
||||
Reference in New Issue
Block a user