Exception problem with module

Chris Angelico rosuav at gmail.com
Tue May 13 13:05:49 EDT 2014


On Wed, May 14, 2014 at 2:59 AM, Joseph L. Casale
<jcasale at activenetwerx.com> wrote:
> During handling of the above exception, another exception occurred:
>
>   File "C:/dir/test.py", line 12, in <module>
>     except a_new_name as exc:
> TypeError: catching classes that do not inherit from BaseException is not allowed

Best would be to print out what's in a_new_name to see if it really is
what you think it is. If you think it is what you think it is, have a
look at its __mro__ (method resolution order, it's an attribute of
every class), to see what it's really inheriting. That should show you
what's happening.

ChrisA



More information about the Python-list mailing list