Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5
erp5
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Merge Requests 132
    • Merge Requests 132
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Jobs
  • Commits
  • nexedi
  • erp5erp5
  • Merge Requests
  • !853

Open
Opened Mar 29, 2019 by Jérome Perrin@jerome
  • Report abuse
Report abuse

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

Converts except X, T to except X as T.

  • numliterals

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.

  • raise

Converts raise E, V to raise E(V), and raise E, V, T to raise E(V).with_traceback(T). If E 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.

  • Discussion 12
  • Commits 7
  • Changes 100+
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: nexedi/erp5!853
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号