Commit 795c7e0d authored by Philip Jenvey's avatar Philip Jenvey

fix bound classmethods lacking an im_class

parent 9a1ac7a4
......@@ -616,7 +616,8 @@ class ClassMethod(W_Root):
def descr_classmethod_get(self, space, w_obj, w_klass=None):
if space.is_none(w_klass):
w_klass = space.type(w_obj)
return space.wrap(Method(space, self.w_function, w_klass, space.w_None))
return space.wrap(Method(space, self.w_function, w_klass,
def descr_classmethod__new__(space, w_subtype, w_function):
instance = space.allocate_instance(ClassMethod, w_subtype)
......@@ -388,6 +388,13 @@ class AppTestTypeDef:
# differs from .im_class in case the method is
# defined in some parent class of l's actual class
def test_classmethod_im_class(self):
class Foo(object):
def bar(cls):
assert is type
def test_func_closure(self):
x = 2
def f():
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment