Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r66257:93521d0a62cf Date: 2013-08-20 14:21 +0200 http://bitbucket.org/pypy/pypy/changeset/93521d0a62cf/
Log: Test and fix: 'object' has an empty __init__ which we should not copy. (trying again) diff --git a/rpython/rlib/objectmodel.py b/rpython/rlib/objectmodel.py --- a/rpython/rlib/objectmodel.py +++ b/rpython/rlib/objectmodel.py @@ -737,6 +737,8 @@ """ flatten = {} for base in inspect.getmro(M): + if base is object: + continue for key, value in base.__dict__.items(): if key.startswith('__') and key.endswith('__'): if key not in special_methods: diff --git a/rpython/rlib/test/test_objectmodel.py b/rpython/rlib/test/test_objectmodel.py --- a/rpython/rlib/test/test_objectmodel.py +++ b/rpython/rlib/test/test_objectmodel.py @@ -612,3 +612,12 @@ import_from_mixin(M, special_methods=['__str__']) assert str(A()).startswith('<') assert str(B()) == "m!" + + class M(object): + pass + class A(object): + def __init__(self): + self.foo = 42 + class B(A): + import_from_mixin(M) + assert B().foo == 42 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit