Open aayla-secura opened 5 years ago
Most likely because internally to the Python object model, __mro__
access is trying to in turn access __class__
, with that causing the exception since wrapper hasn't been initialised.
What happens if you run the same test with the environment variable WRAPT_DISABLE_EXTENSIONS
set to 1
? This will use the pure Python implementation of ObjectProxy
instead of the C extension.
The whole search order for super()
may well be screwed up anyway given that __class__
is being overridden to return the class type for what is wrapped.
Setting the environment variable WRAPT_DISABLE_EXTENSIONS
to 1
makes no difference: same exception is raised. Do you mean I simply shouldn't be using argument-less super
with ObjectProxy
?
If trying to use the no argument super()
back port for 2.7, then yes at this point it doesn't look like it will work. Would need to dig into how that back port implementation works. I suspect the way it goes about things isn't going to work with anything that overrides __class__()
method. It possibly should be using type()
on the object it has instead, but this is just a wild guess since haven't looked at the code for it.
I'm using the new
super
(future.builtins.newsuper.newsuper
) with Python 2.7.16 (and future 0.17.1) and I am getting an exception when not passing arguments tosuper
. Usingfuture.builtins
'ssuper
with no arguments works with any other class I've tried.