Commit 3601be09 authored by Jason Madden's avatar Jason Madden

Support using the pure python local code on Cpython too; it handles adding...

Support using the pure python local code on Cpython too; it handles adding __new__ differently than PyPy does.
parent 5ba9ab73
......@@ -441,6 +441,13 @@ def __new__(cls, *args, **kw):
return self
try:
local.__new__ = __new__
# 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
# it are stil wrong.
import sys
local.__new__ = classmethod(__new__) if not hasattr(sys, 'pypy_version_info') else __new__
except TypeError:
pass
finally:
del sys
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment