moved os.remove import where it woudn't be noticed by GAE
authorMax Ischenko <ischenko@gmail.com>
Thu, 18 Sep 2008 14:23:33 +0000 (16:23 +0200)
committerMax Ischenko <ischenko@gmail.com>
Thu, 18 Sep 2008 14:23:33 +0000 (16:23 +0200)
--HG--
branch : trunk

jinja2/bccache.py

index 149c0c01eaaf75ecd26d2db7a336c65be8e76269..1a0e7ec7c984a5f1e13116f619937f9620ca859f 100644 (file)
@@ -14,7 +14,7 @@
     :copyright: Copyright 2008 by Armin Ronacher.
     :license: BSD.
 """
-from os import path, listdir, remove
+from os import path, listdir
 import marshal
 import tempfile
 import cPickle as pickle
@@ -208,6 +208,10 @@ class FileSystemBytecodeCache(BytecodeCache):
             f.close()
 
     def clear(self):
+        # imported lazily here because google app-engine doesn't support
+        # write access on the file system and the function does not exist
+        # normally.
+        from os import remove
         files = fnmatch.filter(listdir(self.directory), self.pattern % '*')
         for filename in files:
             try: