WIP: Use python3 compatible syntax where it's already possible
- Loading...
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.
Check out, review, and merge locally
Step 1. Fetch and check out the branch for this merge request
git fetch "https://lab.nexedi.com/jerome/erp5.git" "fix/python3-syntax" git checkout -b "jerome/erp5-fix/python3-syntax" FETCH_HEAD
Step 2. Review the changes locally
Step 3. Merge the branch and fix any conflicts that come up
git fetch origin git checkout "origin/master" git merge --no-ff "jerome/erp5-fix/python3-syntax"
Step 4. Push the result of the merge to GitLab
git push origin "master"
Note that pushing to GitLab requires write access to this repository.
Tip: You can also checkout merge requests locally by following these guidelines.
- You're only seeing other activity in the feed. To add a comment, switch to one of the following options.