Merge pull request #276 from cjmayo/python3_26

{python3_26} Python3: fix fileutil
This commit is contained in:
anarcat 2019-09-09 09:40:18 -04:00 committed by GitHub
commit 5c9376cfe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ import fnmatch
import tempfile
import importlib
from distutils.spawn import find_executable
from builtins import str as str_text
from .decorators import memoized
@ -166,7 +167,7 @@ else:
def pathencode (path):
"""Encode a path string with the platform file system encoding."""
if isinstance(path, unicode) and not os.path.supports_unicode_filenames:
if isinstance(path, str_text) and not os.path.supports_unicode_filenames:
path = path.encode(FSCODING, "replace")
return path