diff options
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r-- | sphinx/util/osutil.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index f3557c3ea..f37c10222 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -176,3 +176,16 @@ def find_catalog_files(docname, srcdir, locale_dirs, lang, compaction): fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() + + +if sys.version_info < (3, 0): + bytes = str +else: + bytes = bytes + + +def abspath(pathdir): + pathdir = path.abspath(pathdir) + if isinstance(pathdir, bytes): + pathdir = pathdir.decode(fs_encoding) + return pathdir |