Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

Wong Wah Meng-R32813 r32813 at freescale.com
Mon Oct 3 04:07:08 EDT 2011


I see. Thanks for the tips. If I run out of time I shall consider only using 2.5. 

Regards,
Wah Meng

-----Original Message-----
From: python-list-bounces+wahmeng=freescale.com at python.org [mailto:python-list-bounces+wahmeng=freescale.com at python.org] On Behalf Of Steven D'Aprano
Sent: Monday, October 03, 2011 3:44 PM
To: python-list at python.org
Subject: Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

On Mon, 03 Oct 2011 06:45:25 +0000, Wong Wah Meng-R32813 wrote:


> Does it mean in newer python I need to migrate all my Exception to
> non-string based exception type? That's should be a lot of changes. :p

Yes.

Python 1.5 is very old. It's over 11 years old.

You might find it easier to first migrate to Python 2.5, where string 
exceptions are still legal and only generate a warning, and then migrate 
to 2.7.

Good luck!




-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list