summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Ischenko <ischenko@gmail.com>2008-09-18 16:23:33 +0200
committerMax Ischenko <ischenko@gmail.com>2008-09-18 16:23:33 +0200
commit03f8823594d1aee450f0861e1e824ae80a3dbe13 (patch)
treefe77f2a0a0a01e38cbf928ebf11a56a40127e116
parent2e46a5c1744067b2c05f7ae55d4f606748443a5c (diff)
downloadjinja2-03f8823594d1aee450f0861e1e824ae80a3dbe13.tar.gz
moved os.remove import where it woudn't be noticed by GAE
--HG-- branch : trunk
-rw-r--r--jinja2/bccache.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/jinja2/bccache.py b/jinja2/bccache.py
index 149c0c0..1a0e7ec 100644
--- a/jinja2/bccache.py
+++ b/jinja2/bccache.py
@@ -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: