diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-08 12:56:12 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-08 12:56:12 +0200 |
| commit | a4abe7ed56d44418c8203b4605085caf9b349654 (patch) | |
| tree | ae19fcf05e431398aca91ad8c0ab6c5d2f06abc4 | |
| parent | 50c41e77e88e591b25080a8c870c8d08d47aa171 (diff) | |
[py3] abspathu doesn't exist under Python 3.
| -rw-r--r-- | django/utils/_os.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/django/utils/_os.py b/django/utils/_os.py index 82dccd0efe..9eb5e5e8ea 100644 --- a/django/utils/_os.py +++ b/django/utils/_os.py @@ -2,6 +2,7 @@ import os import stat from os.path import join, normcase, normpath, abspath, isabs, sep from django.utils.encoding import force_text +from django.utils import six try: WindowsError = WindowsError @@ -10,13 +11,12 @@ except NameError: pass -# Define our own abspath function that can handle joining -# unicode paths to a current working directory that has non-ASCII -# characters in it. This isn't necessary on Windows since the -# Windows version of abspath handles this correctly. The Windows -# abspath also handles drive letters differently than the pure -# Python implementation, so it's best not to replace it. -if os.name == 'nt': +# Under Python 2, define our own abspath function that can handle joining +# unicode paths to a current working directory that has non-ASCII characters +# in it. This isn't necessary on Windows since the Windows version of abspath +# handles this correctly. It also handles drive letters differently than the +# pure Python implementation, so it's best not to replace it. +if six.PY3 or os.name == 'nt': abspathu = abspath else: def abspathu(path): |
