Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b248e957
Commit
b248e957
authored
Jun 20, 2018
by
Xiang Zhang
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compiling error when missing gdbm version macros (GH-7823)
parent
16eb3bcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
Lib/test/pythoninfo.py
Lib/test/pythoninfo.py
+2
-2
Lib/test/test_dbm_gnu.py
Lib/test/test_dbm_gnu.py
+2
-3
Modules/_gdbmmodule.c
Modules/_gdbmmodule.c
+3
-0
No files found.
Lib/test/pythoninfo.py
View file @
b248e957
...
...
@@ -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
):
...
...
Lib/test/test_dbm_gnu.py
View file @
b248e957
...
...
@@ -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
}
"
)
...
...
Modules/_gdbmmodule.c
View file @
b248e957
...
...
@@ -678,6 +678,8 @@ PyInit__gdbm(void) {
goto
error
;
}
#if defined(GDBM_VERSION_MAJOR) && defined(GDBM_VERSION_MINOR) && \
defined(GDBM_VERSION_PATCH)
PyObject
*
obj
=
Py_BuildValue
(
"iii"
,
GDBM_VERSION_MAJOR
,
GDBM_VERSION_MINOR
,
GDBM_VERSION_PATCH
);
if
(
obj
==
NULL
)
{
...
...
@@ -687,6 +689,7 @@ PyInit__gdbm(void) {
Py_DECREF
(
obj
);
goto
error
;
}
#endif
return
m
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment