Skip to content

Commit b0e3676

Browse files
gopackgo90cackharot
authored andcommitted
Copy python 2.4 fix from suds-jurko
1 parent fe678ba commit b0e3676

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

suds/cache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import cPickle as pickle
3131
except:
3232
import pickle
33+
import shutil
3334

3435
log = getLogger(__name__)
3536

@@ -321,7 +322,11 @@ def __remove_default_location():
321322
322323
"""
323324
if FileCache.remove_default_location_on_exit:
324-
import shutil
325+
# We must not load shutil here on-demand as under some
326+
# circumstances this may cause the shutil.rmtree() operation to
327+
# fail due to not having some internal module loaded. E.g. this
328+
# happens if you run the project's test suite using the setup.py
329+
# test command on Python 2.4.x.
325330
shutil.rmtree(FileCache.__default_location, ignore_errors=True)
326331

327332

0 commit comments

Comments
 (0)