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
7c96119f
Commit
7c96119f
authored
Jan 24, 2017
by
Tres Seaver
Committed by
GitHub
Jan 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #57 from zopefoundation/py35-import-incompat
Work around AttributeError raised by Python 3.5.x.
parents
f4531e4b
fb38ed5a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
BTrees/BTreeModuleTemplate.c
BTrees/BTreeModuleTemplate.c
+11
-1
CHANGES.rst
CHANGES.rst
+4
-0
No files found.
BTrees/BTreeModuleTemplate.c
View file @
7c96119f
...
@@ -558,8 +558,18 @@ module_init(void)
...
@@ -558,8 +558,18 @@ 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
)
{
/* The Capsule API attempts to import 'persistent' and then
* walk down to the specified attribute using getattr. If the C
* extensions aren't available, this can result in an
* AttributeError being raised. Let that percolate up as an
* ImportError so it can be caught in the expected way.
*/
if
(
PyErr_Occurred
()
&&
!
PyErr_ExceptionMatches
(
PyExc_ImportError
))
{
PyErr_SetString
(
PyExc_ImportError
,
"persistent C extension unavailable"
);
}
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
...
...
CHANGES.rst
View file @
7c96119f
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
------------------
------------------
- Add support for Python 3.6.
- Add support for Python 3.6.
- Raise an ``ImportError`` consistently on Python 3 if the C extension for
BTrees is used but the ``persistent`` C extension is not available.
Previously this could result in an odd ``AttributeError``. See
https://github.com/zopefoundation/BTrees/pull/55
4.4.0 (2017-01-11)
4.4.0 (2017-01-11)
------------------
------------------
...
...
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