Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
gevent
Commits
3fe70aca
Commit
3fe70aca
authored
Mar 01, 2022
by
Victor Stinner
Committed by
Jason Madden
Oct 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Python 3.11 beta 3 support
Co-Authored-By:
Petr Viktorin
<
encukou@gmail.com
>
parent
e29bd2ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
18 deletions
+35
-18
_setuputils.py
_setuputils.py
+3
-0
src/gevent/_gevent_cgreenlet.pxd
src/gevent/_gevent_cgreenlet.pxd
+30
-17
src/gevent/greenlet.py
src/gevent/greenlet.py
+2
-1
No files found.
_setuputils.py
View file @
3fe70aca
...
@@ -244,6 +244,9 @@ def cythonize1(ext):
...
@@ -244,6 +244,9 @@ def cythonize1(ext):
'infer_types'
:
True
,
'infer_types'
:
True
,
'nonecheck'
:
False
,
'nonecheck'
:
False
,
},
},
compile_time_env
=
{
'PY39B1'
:
sys
.
hexversion
>=
0x030900B1
,
},
# The common_utility_include_dir (not well documented)
# The common_utility_include_dir (not well documented)
# causes Cython to emit separate files for much of the
# causes Cython to emit separate files for much of the
# static support code. Each of the modules then includes
# static support code. Each of the modules then includes
...
...
src/gevent/_gevent_cgreenlet.pxd
View file @
3fe70aca
...
@@ -52,35 +52,48 @@ cdef inline void greenlet_init():
...
@@ -52,35 +52,48 @@ cdef inline void greenlet_init():
PyGreenlet_Import
()
PyGreenlet_Import
()
_greenlet_imported
=
True
_greenlet_imported
=
True
c
def
extern
from
"Python.h"
:
c
typedef
object
CodeType
ctypedef
class
types
.
CodeType
[
object
PyCodeObject
]
:
IF
PY39B1
:
pass
ctypedef
object
FrameType
cdef
extern
from
"frameobject.h"
:
cdef
extern
from
"Python.h"
:
CodeType
PyFrame_GetCode
(
FrameType
frame
)
void
*
PyFrame_GetBack
(
FrameType
frame
)
ELSE
:
cdef
extern
from
"frameobject.h"
:
ctypedef
class
types
.
FrameType
[
object
PyFrameObject
]:
ctypedef
class
types
.
FrameType
[
object
PyFrameObject
]:
# We don't have PyFrame_GetCode, need to use the pointer directly
cdef
CodeType
f_code
cdef
CodeType
f_code
# Accessing the f_lineno directly doesn't work. There is an accessor
# function, PyFrame_GetLineNumber that is needed to turn the raw line number
# into the executing line number.
# cdef int f_lineno
# We can't declare this in the object as an object, because it's
# We can't declare this in the object as an object, because it's
# allowed to be NULL, and Cython can't handle that.
# allowed to be NULL, and Cython can't handle that.
# We have to go through the python machinery to get a
# We have to go through the python machinery to get a
# proper None instead, or use an inline
function.
# proper None instead, or use a
function.
cdef
void
*
f_back
cdef
void
*
f_back
cdef
extern
from
"frameobject.h"
:
int
PyFrame_GetLineNumber
(
FrameType
frame
)
int
PyFrame_GetLineNumber
(
FrameType
frame
)
@
cython
.
nonecheck
(
False
)
@
cython
.
nonecheck
(
False
)
cdef
inline
FrameType
get_f_back
(
FrameType
frame
):
cdef
inline
FrameType
get_f_back
(
FrameType
frame
):
if
frame
.
f_back
!=
NULL
:
IF
PY39B1
:
return
<
FrameType
>
frame
.
f_back
f_back
=
PyFrame_GetBack
(
frame
)
ELSE
:
f_back
=
frame
.
f_back
if
f_back
!=
NULL
:
return
<
FrameType
>
f_back
cdef
inline
int
get_f_lineno
(
FrameType
frame
):
cdef
inline
int
get_f_lineno
(
FrameType
frame
):
return
PyFrame_GetLineNumber
(
frame
)
return
PyFrame_GetLineNumber
(
frame
)
cdef
inline
CodeType
get_f_code
(
FrameType
frame
):
IF
PY39B1
:
return
PyFrame_GetCode
(
frame
)
ELSE
:
return
frame
.
f_code
cdef
void
_init
()
cdef
void
_init
()
cdef
class
SpawnedLink
:
cdef
class
SpawnedLink
:
...
...
src/gevent/greenlet.py
View file @
3fe70aca
...
@@ -58,6 +58,7 @@ locals()['get_generic_parent'] = lambda s: s.parent
...
@@ -58,6 +58,7 @@ locals()['get_generic_parent'] = lambda s: s.parent
# Frame access
# Frame access
locals
()[
'get_f_back'
]
=
lambda
frame
:
frame
.
f_back
locals
()[
'get_f_back'
]
=
lambda
frame
:
frame
.
f_back
locals
()[
'get_f_lineno'
]
=
lambda
frame
:
frame
.
f_lineno
locals
()[
'get_f_lineno'
]
=
lambda
frame
:
frame
.
f_lineno
locals
()[
'get_f_code'
]
=
lambda
frame
:
frame
.
f_code
if
_PYPY
:
if
_PYPY
:
import
_continuation
# pylint:disable=import-error
import
_continuation
# pylint:disable=import-error
...
@@ -157,7 +158,7 @@ def _extract_stack(limit):
...
@@ -157,7 +158,7 @@ def _extract_stack(limit):
# Arguments are always passed to the constructor as Python objects,
# Arguments are always passed to the constructor as Python objects,
# meaning we wind up boxing the f_lineno just to unbox it if we pass it.
# meaning we wind up boxing the f_lineno just to unbox it if we pass it.
# It's faster to simply assign once the object is created.
# It's faster to simply assign once the object is created.
older_Frame
.
f_code
=
frame
.
f_code
older_Frame
.
f_code
=
get_f_code
(
frame
)
older_Frame
.
f_lineno
=
get_f_lineno
(
frame
)
# pylint:disable=undefined-variable
older_Frame
.
f_lineno
=
get_f_lineno
(
frame
)
# pylint:disable=undefined-variable
if
newer_Frame
is
not
None
:
if
newer_Frame
is
not
None
:
newer_Frame
.
f_back
=
older_Frame
newer_Frame
.
f_back
=
older_Frame
...
...
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