Skip to content

Commit a8c4d1c

Browse files
author
Richard Jones
committed
I was certain I'd already done this (there's even a change note in CHANGES).
1 parent 5d82207 commit a8c4d1c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

roundup/backends/__init__.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: __init__.py,v 1.9 2001-12-12 02:30:51 richard Exp $
18+
# $Id: __init__.py,v 1.10 2002-01-22 07:08:50 richard Exp $
1919

2020
__all__ = []
2121

2222
try:
23-
import anydbm, dumbdbm
24-
# dumbdbm in python 2,2b2, 2.1.1 and earlier is seriously broken
25-
assert anydbm._defaultmod != dumbdbm
26-
del anydbm
27-
del dumbdbm
23+
import sys
24+
if not hasattr(sys, 'version_info') or sys.version_info < (2,1,2):
25+
import anydbm, dumbdbm
26+
# dumbdbm only works in python 2.1.2+
27+
assert anydbm._defaultmod != dumbdbm
28+
del anydbm
29+
del dumbdbm
2830
import back_anydbm
2931
anydbm = back_anydbm
3032
__all__.append('anydbm')
@@ -49,6 +51,15 @@
4951

5052
#
5153
# $Log: not supported by cvs2svn $
54+
# Revision 1.9 2001/12/12 02:30:51 richard
55+
# I fixed the problems with people whose anydbm was using the dbm module at the
56+
# backend. It turns out the dbm module modifies the file name to append ".db"
57+
# and my check to determine if we're opening an existing or new db just
58+
# tested os.path.exists() on the filename. Well, no longer! We now perform a
59+
# much better check _and_ cope with the anydbm implementation module changing
60+
# too!
61+
# I also fixed the backends __init__ so only ImportError is squashed.
62+
#
5263
# Revision 1.8 2001/12/10 22:20:01 richard
5364
# Enabled transaction support in the bsddb backend. It uses the anydbm code
5465
# where possible, only replacing methods where the db is opened (it uses the

0 commit comments

Comments
 (0)