summaryrefslogtreecommitdiffstats
path: root/Lib/dbm/__init__.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-07-07 11:15:08 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-07-07 11:15:08 (GMT)
commitb08495bbcfea7440f56bbc786b64cbaadaeb604f (patch)
tree0811cb8fc23461ea59609d09cf152a9325048bd9 /Lib/dbm/__init__.py
parent331c3fd874333b71bd315c0541349fcaebabfdcb (diff)
downloadcpython-b08495bbcfea7440f56bbc786b64cbaadaeb604f.zip
cpython-b08495bbcfea7440f56bbc786b64cbaadaeb604f.tar.gz
cpython-b08495bbcfea7440f56bbc786b64cbaadaeb604f.tar.bz2
#17198: Fix a NameError in the dbm module. Patch by Valentina Mukhamedzhanova.
Diffstat (limited to 'Lib/dbm/__init__.py')
-rw-r--r--Lib/dbm/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/dbm/__init__.py b/Lib/dbm/__init__.py
index 813a29d..a783fde 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -44,6 +44,11 @@ _modules = {}
error = (error, IOError)
+try:
+ from dbm import ndbm
+except ImportError:
+ ndbm = None
+
def open(file, flag='r', mode=0o666):
"""Open or create database at path given by *file*.