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:
except X, Tto
except X as T.
Converts octal literals into the new syntax.
Using a modified version ( $366 ) that keeps longs as longs and does not rewrite
0o1 but simply as
1 as we actually had a lot, especially for
raise E, Vto
raise E(V), and
raise E, V, Tto
raise E(V).with_traceback(T). If
Eis 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.