summaryrefslogtreecommitdiffstats
path: root/Lib/dbm
diff options
context:
space:
mode:
authorMarco Rougeth <marco@rougeth.com>2019-04-29 23:23:28 (GMT)
committerBrett Cannon <54418+brettcannon@users.noreply.github.com>2019-04-29 23:23:28 (GMT)
commit81c5a905951aaf46f292eb459c32649c0b74ef61 (patch)
tree134df402ec716cc3e79dafc6a0ea1c8d80d8ffcb /Lib/dbm
parent9bdd6d1c2a61e0a27dba063e9eccf70e295f73a4 (diff)
downloadcpython-81c5a905951aaf46f292eb459c32649c0b74ef61.zip
cpython-81c5a905951aaf46f292eb459c32649c0b74ef61.tar.gz
cpython-81c5a905951aaf46f292eb459c32649c0b74ef61.tar.bz2
bpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060)
Diffstat (limited to 'Lib/dbm')
-rw-r--r--Lib/dbm/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/dbm/__init__.py b/Lib/dbm/__init__.py
index 6831a84..f65da52 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -82,7 +82,8 @@ def open(file, flag='r', mode=0o666):
# file doesn't exist and the new flag was used so use default type
mod = _defaultmod
else:
- raise error[0]("need 'c' or 'n' flag to open new db")
+ raise error[0]("db file doesn't exist; "
+ "use 'c' or 'n' flag to create a new db")
elif result == "":
# db type cannot be determined
raise error[0]("db type could not be determined")