Fixed a missing exception (`WindowsError`) when using the rmtree error handler on non-Windows systems.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a9a0f0b03f
commit
ad1c376d39
|
@ -3,6 +3,13 @@ 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_unicode
|
from django.utils.encoding import force_unicode
|
||||||
|
|
||||||
|
try:
|
||||||
|
WindowsError = WindowsError
|
||||||
|
except NameError:
|
||||||
|
class WindowsError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Define our own abspath function that can handle joining
|
# 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 in it. This isn't necessary on Windows since the
|
# characters in it. This isn't necessary on Windows since the
|
||||||
|
@ -45,6 +52,7 @@ def safe_join(base, *paths):
|
||||||
'path component (%s)' % (final_path, base_path))
|
'path component (%s)' % (final_path, base_path))
|
||||||
return final_path
|
return final_path
|
||||||
|
|
||||||
|
|
||||||
def rmtree_errorhandler(func, path, exc_info):
|
def rmtree_errorhandler(func, path, exc_info):
|
||||||
"""
|
"""
|
||||||
On Windows, some files are read-only (e.g. in in .svn dirs), so when
|
On Windows, some files are read-only (e.g. in in .svn dirs), so when
|
||||||
|
|
Loading…
Reference in New Issue