Author: Armin Rigo <ar...@tunes.org> Branch: refactor-wrapped-del Changeset: r45472:a528c8f27198 Date: 2011-07-11 14:36 +0200 http://bitbucket.org/pypy/pypy/changeset/a528c8f27198/
Log: Pfffff. diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py --- a/pypy/objspace/std/mapdict.py +++ b/pypy/objspace/std/mapdict.py @@ -431,14 +431,17 @@ return None assert isinstance(lifeline, WeakrefLifeline) return lifeline + getweakref._cannot_really_call_random_things_ = True def setweakref(self, space, weakreflifeline): from pypy.module._weakref.interp__weakref import WeakrefLifeline assert isinstance(weakreflifeline, WeakrefLifeline) self._get_mapdict_map().write(self, ("weakref", SPECIAL), weakreflifeline) + setweakref._cannot_really_call_random_things_ = True def delweakref(self): self._get_mapdict_map().write(self, ("weakref", SPECIAL), None) + delweakref._cannot_really_call_random_things_ = True class ObjectMixin(object): _mixin_ = True diff --git a/pypy/rpython/rclass.py b/pypy/rpython/rclass.py --- a/pypy/rpython/rclass.py +++ b/pypy/rpython/rclass.py @@ -393,8 +393,8 @@ oldlength = len(seen) for caller, callee in callgraph: if caller in seen and callee not in seen: - if (hasattr(callee, 'func') and - getattr(callee.func, '_dont_reach_me_in_del_',False)): + func = getattr(callee, 'func', None) + if getattr(func, '_dont_reach_me_in_del_', False): lst = [str(callee)] g = caller while g: @@ -404,6 +404,9 @@ raise TyperError("the RPython-level __del__() method " "in %r calls:%s" % ( graph, '\n\t'.join(lst[::-1]))) + if getattr(func, '_cannot_really_call_random_things_', + False): + continue seen[callee] = caller if len(seen) == oldlength: break _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit