WIP: Use python3 compatible syntax where it's already possible
Use https://docs.python.org/2/library/2to3.html to apply already refactorings that produce code that are still compatible with python 2:
Converts
except X, T
toexcept X as T
.
Converts octal literals into the new syntax.
Using a modified version ( $366 ) that keeps longs as longs and does not rewrite 01
as 0o1
but simply as 1
as we actually had a lot, especially for DateTime
.
Converts
raise E, V
toraise E(V)
, andraise E, V, T
toraise E(V).with_traceback(T)
. IfE
is a tuple, the translation will be incorrect because substituting tuples for exceptions has been removed in Python 3.
using a modified version ( $368 ) that does not translate the later to raise E(V).with_traceback(T)
as this is not supported in python2.