This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients merchise, ncoghlan, r.david.murray, rhettinger
Date 2015-10-20.21:10:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445375416.4.0.0409967073439.issue25448@psf.upfronthosting.co.za>
In-reply-to
Content
What are you trying to accomplish that needs an abstract base class?

APIError is not an Exception class, it is a meta-class, and thus it does not match the exception because it is not a *base* class of DriverError (it is DiverError's *meta* class).

Now, it is an interesting question whether we want the try/except statement's behavior to match issubclass, since intuitively we think the except in try except is doing the equivalent of issubclass (it isn't).

I don't know why this works in python2, but the class/meta-class machinery did undergo some significant changes.  So, it is possible that this is in fact a bug (ie: an unintentional change in semantics).  If so, it is also a doc bug, since the try statement docs clear say the expression must evaluate to a base class, and the virtual class (abc) docs *only* mention issubclass and isinstance.
History
Date User Action Args
2015-10-20 21:10:16r.david.murraysetrecipients: + r.david.murray, rhettinger, ncoghlan, merchise
2015-10-20 21:10:16r.david.murraysetmessageid: <1445375416.4.0.0409967073439.issue25448@psf.upfronthosting.co.za>
2015-10-20 21:10:16r.david.murraylinkissue25448 messages
2015-10-20 21:10:16r.david.murraycreate