]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Geoffrey Gerrietts discovered that a KeyError was caught that probably
authorGuido van Rossum <guido@python.org>
Mon, 15 Jan 2001 16:53:58 +0000 (16:53 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Jan 2001 16:53:58 +0000 (16:53 +0000)
should have been a NameError.  I'm checking in a change that catches
both, just to be sure -- I can't be bothered trying to understand this
code any more. :-)

Demo/metaclasses/Meta.py

index 771205cf3d06f6cf075124e5619605beb8e5e6e2..39cbef6266f9040a17428a818b671f0acde8f06c 100644 (file)
@@ -30,7 +30,7 @@ class MetaHelper:
         except AttributeError:
             try:
                 ga = self.__formalclass__.__getattr__('__usergetattr__')
-            except KeyError:
+            except (KeyError, AttributeError):
                 raise AttributeError, name
             return ga(self, name)
         if type(raw) != types.FunctionType: