Skip to content

Commit

Permalink
Use shutil.rmtree instead of os.unlink to remove directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellrj committed Mar 9, 2012
1 parent 797d1af commit 5b8674d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/chameleon/loader.py
@@ -1,11 +1,13 @@
import os
import functools
import imp
import sys
import py_compile
import logging
import functools
import os
import py_compile
import shutil
import sys
import tempfile
import warnings

import pkg_resources

log = logging.getLogger('chameleon.loader')
Expand Down Expand Up @@ -104,7 +106,7 @@ def __del__(self):
if not self.remove:
return
try:
os.unlink(self.path)
shutil.rmtree(self.path)
except:
warnings.warn("Could not clean up temporary file path: %s" % (self.path,))

Expand Down

0 comments on commit 5b8674d

Please sign in to comment.