summaryrefslogtreecommitdiffstats
path: root/Lib/genericpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-13 10:02:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-13 10:02:05 (GMT)
commit2bd8b22b6de76851a7e36dc4a92d20930335ff57 (patch)
tree648a3e23f9a7d001b061930d3d07ef772de5477f /Lib/genericpath.py
parent4068b01cb55a66efca605d64b6e27d9fd7cebd3e (diff)
downloadcpython-2bd8b22b6de76851a7e36dc4a92d20930335ff57.zip
cpython-2bd8b22b6de76851a7e36dc4a92d20930335ff57.tar.gz
cpython-2bd8b22b6de76851a7e36dc4a92d20930335ff57.tar.bz2
Issue #21840: Fixed expanding unicode variables of form $var in
posixpath.expandvars(). Fixed all os.path implementations on unicode-disabled builds.
Diffstat (limited to 'Lib/genericpath.py')
-rw-r--r--Lib/genericpath.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/genericpath.py b/Lib/genericpath.py
index 7ddb94c..2648e54 100644
--- a/Lib/genericpath.py
+++ b/Lib/genericpath.py
@@ -10,6 +10,14 @@ __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
+try:
+ _unicode = unicode
+except NameError:
+ # If Python is built without Unicode support, the unicode type
+ # will not exist. Fake one.
+ class _unicode(object):
+ pass
+
# Does a path exist?
# This is false for dangling symbolic links on systems that support them.
def exists(path):