comparison roundup/backends/__init__.py @ 2976:e03ef8a8df7f

2.4 compat
author Anthony Baxter <anthonybaxter@users.sourceforge.net>
date Mon, 29 Nov 2004 02:07:59 +0000
parents 6610a5e3c1d5
children 4fcb61bfe4ec
comparison
equal deleted inserted replaced
2975:7edf7779145b 2976:e03ef8a8df7f
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: __init__.py,v 1.31 2004-11-20 11:31:42 a1s Exp $ 18 # $Id: __init__.py,v 1.32 2004-11-29 02:07:59 anthonybaxter Exp $
19 19
20 '''Container for the hyperdb storage backend implementations. 20 '''Container for the hyperdb storage backend implementations.
21 ''' 21 '''
22 __docformat__ = 'restructuredtext' 22 __docformat__ = 'restructuredtext'
23 23
41 # import the backend module 41 # import the backend module
42 module_name = 'back_%s' % name 42 module_name = 'back_%s' % name
43 try: 43 try:
44 module = __import__(module_name, vars) 44 module = __import__(module_name, vars)
45 except: 45 except:
46 # import failed, but the (empty) module is already 46 # import failed, but in versions prior to 2.4, a (broken)
47 # placed in sys.modules and package globals; 47 # module is left in sys.modules and package globals;
48 # next import would success although the module is unusable 48 # next import would success although the module is unusable
49 del sys.modules['.'.join((__name__, module_name))] 49 if sys.version_info < (2, 4):
50 del vars[module_name] 50 del sys.modules['.'.join((__name__, module_name))]
51 del vars[module_name]
51 raise 52 raise
52 else: 53 else:
53 vars[name] = module 54 vars[name] = module
54 return module 55 return module
55 56

Roundup Issue Tracker: http://roundup-tracker.org/