Skip to content

Commit 5e6067d

Browse files
author
Anthony Baxter
committed
2.4 compat
1 parent f489ac5 commit 5e6067d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

roundup/backends/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
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 $
1919

2020
'''Container for the hyperdb storage backend implementations.
2121
'''
@@ -43,11 +43,12 @@ def get_backend(name):
4343
try:
4444
module = __import__(module_name, vars)
4545
except:
46-
# import failed, but the (empty) module is already
47-
# placed in sys.modules and package globals;
46+
# import failed, but in versions prior to 2.4, a (broken)
47+
# module is left in sys.modules and package globals;
4848
# next import would success although the module is unusable
49-
del sys.modules['.'.join((__name__, module_name))]
50-
del vars[module_name]
49+
if sys.version_info < (2, 4):
50+
del sys.modules['.'.join((__name__, module_name))]
51+
del vars[module_name]
5152
raise
5253
else:
5354
vars[name] = module

0 commit comments

Comments
 (0)