Skip to content
Snippets Groups Projects
Commit f9895752 authored by Ben Bangert's avatar Ben Bangert
Browse files

Adding Python 2.3 hack for Beaker import to work properly without memcached.

parent f594e723
No related branches found
No related tags found
No related merge requests found
......@@ -3,20 +3,20 @@ from mako import exceptions
try:
import beaker.container as container
import beaker.exceptions
clsmap = {
'memory':container.MemoryContainer,
'dbm':container.DBMContainer,
'file':container.FileContainer,
}
try:
import beaker.ext.memcached as memcached
clsmap = {
'memory':container.MemoryContainer,
'dbm':container.DBMContainer,
'file':container.FileContainer,
'memcached':memcached.MemcachedContainer
}
# XXX HACK: Python 2.3 under some circumstances will import this module
# even though there's no memcached. This ensures its really
# there before adding it.
if hasattr(memcached, 'MemcachedContainer'):
clsmap['memcached'] = memcached.MemcachedContainer
except beaker.exceptions.BeakerException:
clsmap = {
'memory':container.MemoryContainer,
'dbm':container.DBMContainer,
'file':container.FileContainer,
}
pass
except ImportError:
container = None
clsmap = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment