mirror of
https://github.com/django/django.git
synced 2025-03-26 09:10:50 +00:00
Fixed deletion of the runtests temp tree to work on Windows even when the tree contains non-ASCII filenames.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
db2b1458b1
commit
5df784ab42
@ -130,8 +130,11 @@ def setup(verbosity, test_labels):
|
|||||||
|
|
||||||
def teardown(state):
|
def teardown(state):
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
# Removing the temporary TEMP_DIR
|
# Removing the temporary TEMP_DIR. Ensure we pass in unicode
|
||||||
shutil.rmtree(TEMP_DIR)
|
# so that it will successfully remove temp trees containing
|
||||||
|
# non-ASCII filenames on Windows. (We're assuming the temp dir
|
||||||
|
# name itself does not contain non-ASCII characters.)
|
||||||
|
shutil.rmtree(unicode(TEMP_DIR))
|
||||||
# Restore the old settings.
|
# Restore the old settings.
|
||||||
for key, value in state.items():
|
for key, value in state.items():
|
||||||
setattr(settings, key, value)
|
setattr(settings, key, value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user