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
6c837a6a
Commit
6c837a6a
authored
Sep 25, 2017
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PyPy3 behaves like CPython and needs @classmethod.
parent
3601be09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/gevent/local.py
src/gevent/local.py
+9
-5
No files found.
src/gevent/local.py
View file @
6c837a6a
...
...
@@ -436,17 +436,21 @@ class local(object):
def
__new__
(
cls
,
*
args
,
**
kw
):
self
=
super
(
local
,
cls
).
__new__
(
cls
)
# We get the cls in *args for some reason
# too when we do it this way.
# too when we do it this way....except on PyPy3, which does
# not *unless* it's wrapped in a classmethod (which it is)
self
.
__cinit__
(
*
args
[
1
:],
**
kw
)
return
self
try
:
# PyPy and CPython handle adding a __new__ to the class
# in different ways. In CPython, it must be wrapped with classmethod;
# in PyPy, it must not. In either case, the args that get passed to
# PyPy
2/3
and CPython handle adding a __new__ to the class
# in different ways. In CPython
and PyPy3
, it must be wrapped with classmethod;
# in PyPy
2
, it must not. In either case, the args that get passed to
# it are stil wrong.
import
sys
local
.
__new__
=
classmethod
(
__new__
)
if
not
hasattr
(
sys
,
'pypy_version_info'
)
else
__new__
if
hasattr
(
sys
,
'pypy_version_info'
)
and
sys
.
version_info
[:
2
]
<
(
3
,
0
):
local
.
__new__
=
__new__
else
:
local
.
__new__
=
classmethod
(
__new__
)
except
TypeError
:
pass
finally
:
...
...
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