proxy.py (13719:74853963ddcf) proxy.py (13742:9bc48e81b57e)
1# Copyright (c) 2018 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 173 unchanged lines hidden (view full) ---

182
183 def find(self, obj):
184 try:
185 val = getattr(obj, self._attr)
186 visited = False
187 if hasattr(val, '_visited'):
188 visited = getattr(val, '_visited')
189
1# Copyright (c) 2018 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 173 unchanged lines hidden (view full) ---

182
183 def find(self, obj):
184 try:
185 val = getattr(obj, self._attr)
186 visited = False
187 if hasattr(val, '_visited'):
188 visited = getattr(val, '_visited')
189
190 if not visited:
190 if visited:
191 return None, False
192
193 if not isproxy(val):
191 # for any additional unproxying to be done, pass the
192 # current, rather than the original object so that proxy
193 # has the right context
194 obj = val
194 # for any additional unproxying to be done, pass the
195 # current, rather than the original object so that proxy
196 # has the right context
197 obj = val
195 else:
196 return None, False
198
197 except:
198 return None, False
199 while isproxy(val):
200 val = val.unproxy(obj)
201 for m in self._modifiers:
202 if isinstance(m, str):
203 val = getattr(val, m)
204 elif isinstance(m, int):

--- 65 unchanged lines hidden ---
199 except:
200 return None, False
201 while isproxy(val):
202 val = val.unproxy(obj)
203 for m in self._modifiers:
204 if isinstance(m, str):
205 val = getattr(val, m)
206 elif isinstance(m, int):

--- 65 unchanged lines hidden ---