Fix compiling error when missing gdbm version macros (GH-7823) · pythoncapi/cpython@b248e95 · GitHub
Skip to content

Commit b248e95

Browse files
authored
Fix compiling error when missing gdbm version macros (pythonGH-7823)
1 parent 16eb3bc commit b248e95

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/test/pythoninfo.py

Lines changed: 2 additions & 2 deletions

Lib/test/test_dbm_gnu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ class TestGdbm(unittest.TestCase):
1212
def setUpClass():
1313
if support.verbose:
1414
try:
15-
import _gdbm
16-
version = _gdbm._GDBM_VERSION
17-
except (ImportError, AttributeError):
15+
from _gdbm import _GDBM_VERSION as version
16+
except ImportError:
1817
pass
1918
else:
2019
print(f"gdbm version: {version}")

Modules/_gdbmmodule.c

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)