mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Replaced "not PY3" by "PY2", new in six 1.4.0.
This commit is contained in:
@@ -12,7 +12,7 @@ except NameError:
|
||||
class WindowsError(Exception):
|
||||
pass
|
||||
|
||||
if not six.PY3:
|
||||
if six.PY2:
|
||||
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ def upath(path):
|
||||
"""
|
||||
Always return a unicode path.
|
||||
"""
|
||||
if not six.PY3 and not isinstance(path, six.text_type):
|
||||
if six.PY2 and not isinstance(path, six.text_type):
|
||||
return path.decode(fs_encoding)
|
||||
return path
|
||||
|
||||
@@ -47,7 +47,7 @@ def npath(path):
|
||||
Always return a native path, that is unicode on Python 3 and bytestring on
|
||||
Python 2.
|
||||
"""
|
||||
if not six.PY3 and not isinstance(path, bytes):
|
||||
if six.PY2 and not isinstance(path, bytes):
|
||||
return path.encode(fs_encoding)
|
||||
return path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user