[issue10070] 2to3 wishes for already-2to3'ed files
Martin v. Löwis
report at bugs.python.org
Sat Nov 13 07:53:13 CET 2010
Martin v. Löwis <martin at v.loewis.de> added the comment:
> Consider here:
> the py3k code uses the "raise ... from" syntax which isn't legal in Python 2.
In this case, I would write
error = exc.DBAPIError.instance(statement,
if sys.version_info < (3,):
raise error, None, sys.exc_info()
error.__cause__ = e
You don't *have* to use the from syntax to set the cause.
> Approach B isn't a general solution because it requires you to replace entire functions at a time.
I don't claim that. However, I claim that there will be always an
appropriate solution using existing techniques, so that such a macro
processing wouldn't be necessary. IOW, I'm not aware of a case where
using such preprocessing would be appropriate and better than what
you can do without.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list