mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	[py3] abspathu doesn't exist under Python 3.
This commit is contained in:
		| @@ -2,6 +2,7 @@ import os | |||||||
| import stat | import stat | ||||||
| from os.path import join, normcase, normpath, abspath, isabs, sep | from os.path import join, normcase, normpath, abspath, isabs, sep | ||||||
| from django.utils.encoding import force_text | from django.utils.encoding import force_text | ||||||
|  | from django.utils import six | ||||||
|  |  | ||||||
| try: | try: | ||||||
|     WindowsError = WindowsError |     WindowsError = WindowsError | ||||||
| @@ -10,13 +11,12 @@ except NameError: | |||||||
|         pass |         pass | ||||||
|  |  | ||||||
|  |  | ||||||
| # Define our own abspath function that can handle joining | # Under Python 2, define our own abspath function that can handle joining | ||||||
| # unicode paths to a current working directory that has non-ASCII | # unicode paths to a current working directory that has non-ASCII characters | ||||||
| # characters in it.  This isn't necessary on Windows since the | # in it.  This isn't necessary on Windows since the Windows version of abspath | ||||||
| # Windows version of abspath handles this correctly.  The Windows | # handles this correctly. It also handles drive letters differently than the | ||||||
| # abspath also handles drive letters differently than the pure | # pure Python implementation, so it's best not to replace it. | ||||||
| # Python implementation, so it's best not to replace it. | if six.PY3 or os.name == 'nt': | ||||||
| if os.name == 'nt': |  | ||||||
|     abspathu = abspath |     abspathu = abspath | ||||||
| else: | else: | ||||||
|     def abspathu(path): |     def abspathu(path): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user