summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/db2pickle.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-26 10:29:35 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-26 10:29:35 (GMT)
commit0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5 (patch)
treeec61fd6d53e6425b8639567860140c724ea7bc63 /Tools/scripts/db2pickle.py
parente6f00637be87c8f5f0e50bf317d684ea421a6d19 (diff)
downloadcpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.zip
cpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.tar.gz
cpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.tar.bz2
Create the dbm package from PEP 3108. #2881.
Diffstat (limited to 'Tools/scripts/db2pickle.py')
-rw-r--r--Tools/scripts/db2pickle.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Tools/scripts/db2pickle.py b/Tools/scripts/db2pickle.py
index 795011b..0c9b6bf 100644
--- a/Tools/scripts/db2pickle.py
+++ b/Tools/scripts/db2pickle.py
@@ -6,7 +6,7 @@ Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ]
Convert the database file given on the command line to a pickle
representation. The optional flags indicate the type of the database:
- -a - open using anydbm
+ -a - open using dbm (any supported format)
-b - open as bsddb btree file
-d - open as dbm file
-g - open as gdbm file
@@ -25,15 +25,15 @@ try:
except ImportError:
bsddb = None
try:
- import dbm
+ import dbm.ndbm as dbm
except ImportError:
dbm = None
try:
- import gdbm
+ import dbm.gnu as gdbm
except ImportError:
gdbm = None
try:
- import anydbm
+ import dbm as anydbm
except ImportError:
anydbm = None
import sys
@@ -94,19 +94,19 @@ def main(args):
try:
dbopen = anydbm.open
except AttributeError:
- sys.stderr.write("anydbm module unavailable.\n")
+ sys.stderr.write("dbm module unavailable.\n")
return 1
elif opt in ("-g", "--gdbm"):
try:
dbopen = gdbm.open
except AttributeError:
- sys.stderr.write("gdbm module unavailable.\n")
+ sys.stderr.write("dbm.gnu module unavailable.\n")
return 1
elif opt in ("-d", "--dbm"):
try:
dbopen = dbm.open
except AttributeError:
- sys.stderr.write("dbm module unavailable.\n")
+ sys.stderr.write("dbm.ndbm module unavailable.\n")
return 1
if dbopen is None:
if bsddb is None: