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
Kirill Smelkov
cython
Commits
c8f537ff
Commit
c8f537ff
authored
Jun 20, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
0bf060f9
e87fb0ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
CHANGES.rst
CHANGES.rst
+4
-0
Cython/Utility/Builtins.c
Cython/Utility/Builtins.c
+3
-0
tests/run/exectest.pyx
tests/run/exectest.pyx
+15
-0
No files found.
CHANGES.rst
View file @
c8f537ff
...
...
@@ -462,6 +462,10 @@ Bugs fixed
*
Fix
a
regression
in
0.29.20
where
``
__div__
``
failed
to
be
found
in
extension
types
.
(
Github
issue
#
3688
)
*
``
exec
()``
did
not
allow
recent
Python
syntax
features
in
Py3
.8
+
due
to
https
://
bugs
.
python
.
org
/
issue35975
.
(
Github
issue
#
3695
)
*
Binding
staticmethods
of
Cython
functions
were
not
behaving
like
Python
methods
in
Py3
.
Patch
by
Jeroen
Demeyer
and
Micha
ł
G
ó
rny
.
(
Github
issue
#
3106
)
...
...
Cython/Utility/Builtins.c
View file @
c8f537ff
...
...
@@ -100,6 +100,9 @@ static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals)
}
else
{
PyCompilerFlags
cf
;
cf
.
cf_flags
=
0
;
#if PY_VERSION_HEX >= 0x030800A3
cf
.
cf_feature_version
=
PY_MINOR_VERSION
;
#endif
if
(
PyUnicode_Check
(
o
))
{
cf
.
cf_flags
=
PyCF_SOURCE_IS_UTF8
;
s
=
PyUnicode_AsUTF8String
(
o
);
...
...
tests/run/exectest.pyx
View file @
c8f537ff
...
...
@@ -145,3 +145,18 @@ def exec_invalid_type(x):
TypeError: exec: arg 1 must be string, bytes or code object, got int
"""
exec
x
in
{}
def
exec_with_new_features
(
s
,
d
):
"""
>>> import sys
>>> pyversion = sys.version_info[:2]
>>> d = {}
>>> exec_with_new_features('print(123)', d)
123
>>> if pyversion == (2, 7): exec_with_new_features('exec "123"', d)
>>> if pyversion >= (3, 6): exec_with_new_features('f = f"abc"', d)
>>> if pyversion >= (3, 8): exec_with_new_features('a = (b := 1)', d)
"""
exec
s
in
d
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