From: Max Ischenko Date: Thu, 18 Sep 2008 14:23:33 +0000 (+0200) Subject: moved os.remove import where it woudn't be noticed by GAE X-Git-Tag: 2.1~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03f8823594d1aee450f0861e1e824ae80a3dbe13;p=jinja2.git moved os.remove import where it woudn't be noticed by GAE --HG-- branch : trunk --- 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: