summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/pythoninfo.py4
-rw-r--r--Lib/test/test_dbm_gnu.py5
2 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 3958764a6a..f058185c2f 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -527,11 +527,11 @@ def collect_cc(info_add):
def collect_gdbm(info_add):
try:
- import _gdbm
+ from _gdbm import _GDBM_VERSION
except ImportError:
return
- info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _gdbm._GDBM_VERSION)))
+ info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _GDBM_VERSION)))
def collect_info(info):
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index 49f91705b5..c96eff5a31 100644
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -12,9 +12,8 @@ class TestGdbm(unittest.TestCase):
def setUpClass():
if support.verbose:
try:
- import _gdbm
- version = _gdbm._GDBM_VERSION
- except (ImportError, AttributeError):
+ from _gdbm import _GDBM_VERSION as version
+ except ImportError:
pass
else:
print(f"gdbm version: {version}")