Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
ec739210
Commit
ec739210
authored
Dec 26, 2016
by
Tres Seaver
Committed by
Jason Madden
Jan 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around AttributeError raised by Python 3.5.x.
Alternative to PR #55.
parent
f4531e4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
BTrees/BTreeModuleTemplate.c
BTrees/BTreeModuleTemplate.c
+8
-1
No files found.
BTrees/BTreeModuleTemplate.c
View file @
ec739210
...
@@ -558,8 +558,15 @@ module_init(void)
...
@@ -558,8 +558,15 @@ module_init(void)
cPersistenceCAPI
=
(
cPersistenceCAPIstruct
*
)
PyCObject_Import
(
cPersistenceCAPI
=
(
cPersistenceCAPIstruct
*
)
PyCObject_Import
(
"persistent.cPersistence"
,
"CAPI"
);
"persistent.cPersistence"
,
"CAPI"
);
#endif
#endif
if
(
cPersistenceCAPI
==
NULL
)
if
(
cPersistenceCAPI
==
NULL
)
{
/* At least some versions of Python 3.5 raise an AttribteError
* an ImportError here: re-map as an ImportError for compatibility.
*/
if
(
PyErr_Occurred
()
&&
!
PyErr_ExceptionMatches
(
PyExc_ImportError
))
{
PyErr_SetString
(
PyExc_ImportError
,
"<No CPersistence>"
);
}
return
NULL
;
return
NULL
;
}
#ifdef PY3K
#ifdef PY3K
#define _SET_TYPE(typ) ((PyObject*)(&typ))->ob_type = &PyType_Type
#define _SET_TYPE(typ) ((PyObject*)(&typ))->ob_type = &PyType_Type
...
...
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