# HG changeset patch # User Sylvain Thenault <sylvain.thenault@logilab.fr> # Date 1223472747 -7200 # Wed Oct 08 15:32:27 2008 +0200 # Node ID 624fd05e875416be67d9c8afa8f62f1e2d7a9463 # Parent af5c1c50b8da2da9439e7dd9df6d0c97b830f97e fix Variable.set_scope diff --git a/nodes.py b/nodes.py --- a/nodes.py +++ b/nodes.py @@ -949,6 +949,13 @@ def set_scope(self, scopenode): if scopenode is self.stmt or self.stinfo['scope'] is None: self.stinfo['scope'] = scopenode + elif self.stinfo['scope'] is not self.stmt and scopenode is not self.stinfo['scope']: + # XXX get common parent scope if this assertion fail + assert scopenode.parent.scope is self.stinfo['scope'].parent.scope, \ + (scopenode.parent.scope, self.stinfo['scope'].parent.scope) + + self.stinfo['scope'] = scopenode.parent.scope + def get_scope(self): return self.stinfo['scope'] scope = property(get_scope, set_scope) diff --git a/stmts.py b/stmts.py --- a/stmts.py +++ b/stmts.py @@ -162,6 +162,7 @@ def ored(self, traverse_scope=False, _fromnode=None): return None + def neged(self, _fromnode=None, strict=False): return None