]> granicus.if.org Git - python/commit
Major cleanup operation: whenever there's a call that looks for an
authorGuido van Rossum <guido@python.org>
Thu, 13 Jun 2002 21:42:04 +0000 (21:42 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 13 Jun 2002 21:42:04 +0000 (21:42 +0000)
commite7b8ecf196f5d20eb9189fb9930335a2bebe1cc7
tree436e229796fd4ab826e0489e7bcca8fd5172471d
parent16b93b3d0e2bf8dc22d11e8625af6d9cc913ec88
Major cleanup operation: whenever there's a call that looks for an
optional attribute, only clear the exception when the internal getattr
operation raised AttributeError.  Many places in this file already had
that policy; but just as many didn't, and there didn't seem to be any
rhyme or reason to it.  Be consistently cautious.

Question: should I backport this?  On the one hand it's a bugfix.  On
the other hand it's a change in behavior.  Certain forms of buggy or
just weird code would work in the past but raise an exception under
the new rules; e.g. if you define a __getattr__ method that raises a
non-AttributeError exception.
Objects/classobject.c