From: Armin Ronacher Date: Fri, 12 Mar 2010 02:37:03 +0000 (+0100) Subject: Just in case there is no gc module. X-Git-Tag: 2.4~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=95131f27766fb2afa4b0743dcb83e7d1eaa2cb77;p=jinja2.git Just in case there is no gc module. --HG-- branch : trunk --- diff --git a/jinja2/testsuite/loader.py b/jinja2/testsuite/loader.py index a46bda2..e6a552a 100644 --- a/jinja2/testsuite/loader.py +++ b/jinja2/testsuite/loader.py @@ -9,7 +9,6 @@ :license: BSD, see LICENSE for more details. """ import os -import gc import sys import time import tempfile @@ -134,7 +133,13 @@ class ModuleLoaderTestCase(JinjaTestCase): # unset all, ensure the module is gone from sys.modules self.mod_env = tmpl = None - gc.collect() + + try: + import gc + gc.collect() + except: + pass + assert name not in sys.modules