Mercurial > p > roundup > code
view roundup/anypy/dbm_.py @ 4478:e7dcec8c40e9
- Add regression test for -c option to mailgw
.-- bug in issue2550697 wasn't noticed, it would be now.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 14 Apr 2011 07:07:22 +0000 |
| parents | 0d9369d35483 |
| children | d5da643b3d25 |
line wrap: on
line source
# In Python 3 the "anydbm" module was renamed to be "dbm" which is now a # package containing the various implementations. The "wichdb" module's # whichdb() function was moved to the new "dbm" module. import sys if sys.version_info[:2] < (2, 6): def key_in(db, key): return db.has_key(key) else: def key_in(db, key): return key in db try: # old school first because <3 had a "dbm" module too... import anydbm from whichdb import whichdb except ImportError: # python 3+ import dbm as anydbm whichdb = anydbm.whichdb
