File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -527,11 +527,11 @@ def collect_cc(info_add):
527527
528528def collect_gdbm (info_add ):
529529 try :
530- import _gdbm
530+ from _gdbm import _GDBM_VERSION
531531 except ImportError :
532532 return
533533
534- info_add ('gdbm.GDBM_VERSION' , '.' .join (map (str , _gdbm . _GDBM_VERSION )))
534+ info_add ('gdbm.GDBM_VERSION' , '.' .join (map (str , _GDBM_VERSION )))
535535
536536
537537def collect_info (info ):
Original file line number Diff line number Diff 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 } " )
Original file line number Diff line number Diff line change @@ -678,6 +678,8 @@ PyInit__gdbm(void) {
678678 goto error ;
679679 }
680680
681+ #if defined(GDBM_VERSION_MAJOR ) && defined(GDBM_VERSION_MINOR ) && \
682+ defined(GDBM_VERSION_PATCH )
681683 PyObject * obj = Py_BuildValue ("iii" , GDBM_VERSION_MAJOR ,
682684 GDBM_VERSION_MINOR , GDBM_VERSION_PATCH );
683685 if (obj == NULL ) {
@@ -687,6 +689,7 @@ PyInit__gdbm(void) {
687689 Py_DECREF (obj );
688690 goto error ;
689691 }
692+ #endif
690693
691694 return m ;
692695
You can’t perform that action at this time.
0 commit comments