Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Gwenaël Samain
cython
Commits
22eef3dc
Commit
22eef3dc
authored
Aug 10, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable PEP-489 multi-phase module initialisation, now that re-imports are handled with an error.
parent
8ebe2727
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+1
-3
tests/run/reimport_from_package.srctree
tests/run/reimport_from_package.srctree
+2
-3
No files found.
CHANGES.rst
View file @
22eef3dc
...
...
@@ -8,6 +8,9 @@ Cython Changelog
Features
added
--------------
*
PEP
-
489
multi
-
phase
module
initialisation
has
been
enabled
again
.
Module
reloads
raise
an
exception
to
prevent
corruption
of
the
static
module
state
.
*
Raising
exceptions
from
nogil
code
will
automatically
acquire
the
GIL
,
instead
of
requiring
an
explicit
``
with
gil
``
block
.
...
...
Cython/Utility/ModuleSetupCode.c
View file @
22eef3dc
...
...
@@ -178,9 +178,7 @@
#define CYTHON_FAST_PYCALL 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
// Disabled for now. Most extension modules simply can't deal with it, and Cython isn't ready either.
// See issues listed here: https://docs.python.org/3/c-api/init.html#sub-interpreter-support
#define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
...
...
tests/run/reimport_from_package.srctree
View file @
22eef3dc
...
...
@@ -33,9 +33,8 @@ import atest.package.module as module
assert module in sys.modules.values(), list(sys.modules)
assert sys.modules['atest.package.module'] is module, list(sys.modules)
# TODO: re-enable with PEP-489 support
#if sys.version_info >= (3, 5):
# from . import pymodule
if sys.version_info >= (3, 5):
from . import pymodule
######## atest/package/pymodule.py ########
...
...
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