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

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Oct 3 03:44:00 EDT 2011


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



More information about the Python-list mailing list