mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-33901: Add _gdbm._GDBM_VERSION (GH-7794)
* Fix also PyInit__gdbm() to catch errors. * test.pythoninfo: add gdbm.version * test_dbm_gnu now logs GDBM_VERSION when run in verbose mode. * pythoninfo: rename function to collect_gdbm()
This commit is contained in:
parent
06fe77a84b
commit
00f9edb98d
3 changed files with 53 additions and 9 deletions
|
@ -8,6 +8,17 @@ from test.support import TESTFN, TESTFN_NONASCII, unlink
|
|||
filename = TESTFN
|
||||
|
||||
class TestGdbm(unittest.TestCase):
|
||||
@staticmethod
|
||||
def setUpClass():
|
||||
if support.verbose:
|
||||
try:
|
||||
import _gdbm
|
||||
version = _gdbm._GDBM_VERSION
|
||||
except (ImportError, AttributeError):
|
||||
pass
|
||||
else:
|
||||
print(f"gdbm version: {version}")
|
||||
|
||||
def setUp(self):
|
||||
self.g = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue