[svn] applied patch from #272, cmemcached is now used if available
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 24 Jul 2007 07:15:00 +0000 (09:15 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 24 Jul 2007 07:15:00 +0000 (09:15 +0200)
--HG--
branch : trunk

jinja/loaders.py

index aadaad7b86f7b76c1837b04d81f53e4fd244cb31..95d9d8d2428ec03f93c37fde8cb3687fdf6d24ad 100644 (file)
@@ -273,7 +273,10 @@ class MemcachedLoaderMixin(object):
     def __init__(self, use_memcache, memcache_time=60 * 60 * 24 * 7,
                  memcache_host=None, item_prefix='template/'):
         try:
-            from memcache import Client
+            try:
+                from cmemcache import Client
+            except ImportError:
+                from memcache import Client
         except ImportError:
             raise RuntimeError('the %r loader requires an installed '
                                'memcache module' % self.__class__.__name__)