From: <pj...@us...> - 2009-10-07 02:51:08
|
Revision: 6845 http://jython.svn.sourceforge.net/jython/?rev=6845&view=rev Author: pjenvey Date: 2009-10-07 02:50:46 +0000 (Wed, 07 Oct 2009) Log Message: ----------- regen per r6844 Modified Paths: -------------- trunk/jython/src/org/python/antlr/ast/AssertDerived.java trunk/jython/src/org/python/antlr/ast/AssignDerived.java trunk/jython/src/org/python/antlr/ast/AttributeDerived.java trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java trunk/jython/src/org/python/antlr/ast/BinOpDerived.java trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java trunk/jython/src/org/python/antlr/ast/BreakDerived.java trunk/jython/src/org/python/antlr/ast/CallDerived.java trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java trunk/jython/src/org/python/antlr/ast/CompareDerived.java trunk/jython/src/org/python/antlr/ast/ContinueDerived.java trunk/jython/src/org/python/antlr/ast/DeleteDerived.java trunk/jython/src/org/python/antlr/ast/DictDerived.java trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java trunk/jython/src/org/python/antlr/ast/ExecDerived.java trunk/jython/src/org/python/antlr/ast/ExprDerived.java trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java trunk/jython/src/org/python/antlr/ast/ForDerived.java trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java trunk/jython/src/org/python/antlr/ast/GlobalDerived.java trunk/jython/src/org/python/antlr/ast/IfDerived.java trunk/jython/src/org/python/antlr/ast/IfExpDerived.java trunk/jython/src/org/python/antlr/ast/ImportDerived.java trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java trunk/jython/src/org/python/antlr/ast/IndexDerived.java trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java trunk/jython/src/org/python/antlr/ast/LambdaDerived.java trunk/jython/src/org/python/antlr/ast/ListCompDerived.java trunk/jython/src/org/python/antlr/ast/ListDerived.java trunk/jython/src/org/python/antlr/ast/ModuleDerived.java trunk/jython/src/org/python/antlr/ast/NameDerived.java trunk/jython/src/org/python/antlr/ast/NumDerived.java trunk/jython/src/org/python/antlr/ast/PassDerived.java trunk/jython/src/org/python/antlr/ast/PrintDerived.java trunk/jython/src/org/python/antlr/ast/RaiseDerived.java trunk/jython/src/org/python/antlr/ast/ReprDerived.java trunk/jython/src/org/python/antlr/ast/ReturnDerived.java trunk/jython/src/org/python/antlr/ast/SliceDerived.java trunk/jython/src/org/python/antlr/ast/StrDerived.java trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java trunk/jython/src/org/python/antlr/ast/SuiteDerived.java trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java trunk/jython/src/org/python/antlr/ast/TupleDerived.java trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java trunk/jython/src/org/python/antlr/ast/WhileDerived.java trunk/jython/src/org/python/antlr/ast/WithDerived.java trunk/jython/src/org/python/antlr/ast/YieldDerived.java trunk/jython/src/org/python/antlr/ast/aliasDerived.java trunk/jython/src/org/python/antlr/ast/argumentsDerived.java trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java trunk/jython/src/org/python/antlr/ast/keywordDerived.java trunk/jython/src/org/python/antlr/op/AddDerived.java trunk/jython/src/org/python/antlr/op/AndDerived.java trunk/jython/src/org/python/antlr/op/AugLoadDerived.java trunk/jython/src/org/python/antlr/op/AugStoreDerived.java trunk/jython/src/org/python/antlr/op/BitAndDerived.java trunk/jython/src/org/python/antlr/op/BitOrDerived.java trunk/jython/src/org/python/antlr/op/BitXorDerived.java trunk/jython/src/org/python/antlr/op/DelDerived.java trunk/jython/src/org/python/antlr/op/DivDerived.java trunk/jython/src/org/python/antlr/op/EqDerived.java trunk/jython/src/org/python/antlr/op/FloorDivDerived.java trunk/jython/src/org/python/antlr/op/GtDerived.java trunk/jython/src/org/python/antlr/op/GtEDerived.java trunk/jython/src/org/python/antlr/op/InDerived.java trunk/jython/src/org/python/antlr/op/InvertDerived.java trunk/jython/src/org/python/antlr/op/IsDerived.java trunk/jython/src/org/python/antlr/op/IsNotDerived.java trunk/jython/src/org/python/antlr/op/LShiftDerived.java trunk/jython/src/org/python/antlr/op/LoadDerived.java trunk/jython/src/org/python/antlr/op/LtDerived.java trunk/jython/src/org/python/antlr/op/LtEDerived.java trunk/jython/src/org/python/antlr/op/ModDerived.java trunk/jython/src/org/python/antlr/op/MultDerived.java trunk/jython/src/org/python/antlr/op/NotDerived.java trunk/jython/src/org/python/antlr/op/NotEqDerived.java trunk/jython/src/org/python/antlr/op/NotInDerived.java trunk/jython/src/org/python/antlr/op/OrDerived.java trunk/jython/src/org/python/antlr/op/ParamDerived.java trunk/jython/src/org/python/antlr/op/PowDerived.java trunk/jython/src/org/python/antlr/op/RShiftDerived.java trunk/jython/src/org/python/antlr/op/StoreDerived.java trunk/jython/src/org/python/antlr/op/SubDerived.java trunk/jython/src/org/python/antlr/op/UAddDerived.java trunk/jython/src/org/python/antlr/op/USubDerived.java trunk/jython/src/org/python/core/ClasspathPyImporterDerived.java trunk/jython/src/org/python/core/PyArrayDerived.java trunk/jython/src/org/python/core/PyBaseExceptionDerived.java trunk/jython/src/org/python/core/PyBooleanDerived.java trunk/jython/src/org/python/core/PyClassMethodDerived.java trunk/jython/src/org/python/core/PyComplexDerived.java trunk/jython/src/org/python/core/PyDictionaryDerived.java trunk/jython/src/org/python/core/PyEnumerateDerived.java trunk/jython/src/org/python/core/PyFileDerived.java trunk/jython/src/org/python/core/PyFloatDerived.java trunk/jython/src/org/python/core/PyFrozenSetDerived.java trunk/jython/src/org/python/core/PyIntegerDerived.java trunk/jython/src/org/python/core/PyListDerived.java trunk/jython/src/org/python/core/PyLongDerived.java trunk/jython/src/org/python/core/PyModuleDerived.java trunk/jython/src/org/python/core/PyObjectDerived.java trunk/jython/src/org/python/core/PyPropertyDerived.java trunk/jython/src/org/python/core/PySetDerived.java trunk/jython/src/org/python/core/PySliceDerived.java trunk/jython/src/org/python/core/PyStringDerived.java trunk/jython/src/org/python/core/PySuperDerived.java trunk/jython/src/org/python/core/PyTupleDerived.java trunk/jython/src/org/python/core/PyTypeDerived.java trunk/jython/src/org/python/core/PyUnicodeDerived.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java trunk/jython/src/org/python/modules/random/PyRandomDerived.java trunk/jython/src/org/python/modules/thread/PyLocalDerived.java trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java Modified: trunk/jython/src/org/python/antlr/ast/AssertDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/AssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/AttributeDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/BinOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/BreakDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/CallDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/CompareDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ContinueDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/DeleteDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/DictDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ExecDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ExprDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/ForDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/GlobalDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/IfDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors - // and pass through to __getattr__ invocation. - } - } - PyObject getattr=self_type.lookup("__getattr__"); - if (getattr!=null) { - if (py_name==null) { - py_name=PyString.fromInterned(name); - } - return getattr.__get__(this,self_type).__call__(py_name); - } - if (firstAttributeError!=null) { - throw firstAttributeError; - } - return null; + return Deriveds.__findattr_ex__(this,name); } public void __setattr__(String name,PyObject value) { Modified: trunk/jython/src/org/python/antlr/ast/IfExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-10-07 02:48:36 UTC (rev 6844) +++ trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-10-07 02:50:46 UTC (rev 6845) @@ -981,43 +981,7 @@ } public PyObject __findattr_ex__(String name) { - PyType self_type=getType(); - // TODO: We should speed this up. As the __getattribute__ slot almost never - // changes, it is a good candidate for caching, as PyClass does with - // __getattr__. See #1102. - PyObject getattribute=self_type.lookup("__getattribute__"); - PyString py_name=null; - PyException firstAttributeError=null; - try { - if (getattribute!=null) { - py_name=PyString.fromInterned(name); - return getattribute.__get__(this,self_type).__call__(py_name); - } else { - Py.Warning(String.format("__getattribute__ not found on type %s",self_type.getName())); - PyObject ret=super.__findattr_ex__(name); - if (ret!=null) { - return ret; - } // else: pass through to __getitem__ invocation - } - } catch (PyException e) { - if (!e.match(Py.AttributeError)) { - throw e; - } else { - firstAttributeError=e; // saved to avoid swallowing ... [truncated message content] |