Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e03a86c

Browse files
committed
change default flag to match dbm/gdbm
1 parent 1035a89 commit e03a86c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/anydbm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
existing database file.
3232
3333
The open function has an optional second argument. This can be set to
34-
'r' to open the database for reading only. The default is 'w', which
35-
differs from the dbm default ('r') for historic reasons.
34+
'r' to open the database for reading only. The default is 'r', like
35+
the dbm default.
3636
3737
"""
3838

@@ -47,5 +47,5 @@
4747
break
4848
else:
4949
raise ImportError, "no dbm clone found; tried %s" % _names
50-
def open(file, flag = 'w', mode = 0666):
50+
def open(file, flag = 'r', mode = 0666):
5151
return _mod.open(file, flag, mode)

0 commit comments

Comments
 (0)