• Guido van Rossum's avatar
    Major cleanup operation: whenever there's a call that looks for an · e7b8ecf1
    Guido van Rossum yazdı
    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.
    e7b8ecf1
classobject.c 57.1 KB