Skip to content

Commit eea2af3

Browse files
[3.13] gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335) (GH-136379)
On NetBSD, ndbm.open() does not fail for empty file. (cherry picked from commit b7aa2a4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 843e805 commit eea2af3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_dbm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def test_whichdb(self):
213213
@unittest.skipUnless(ndbm, reason='Test requires ndbm')
214214
def test_whichdb_ndbm(self):
215215
# Issue 17198: check that ndbm which is referenced in whichdb is defined
216-
with open(_fname + '.db', 'wb'): pass
216+
with open(_fname + '.db', 'wb') as f:
217+
f.write(b'spam')
217218
_bytes_fname = os.fsencode(_fname)
218219
fnames = [_fname, os_helper.FakePath(_fname),
219220
_bytes_fname, os_helper.FakePath(_bytes_fname)]

0 commit comments

Comments
 (0)