From 03f8823594d1aee450f0861e1e824ae80a3dbe13 Mon Sep 17 00:00:00 2001 From: Max Ischenko Date: Thu, 18 Sep 2008 16:23:33 +0200 Subject: [PATCH] moved os.remove import where it woudn't be noticed by GAE --HG-- branch : trunk --- jinja2/bccache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- 2.26.2