Skip to content

Make code compatible with Python3 #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2020
Merged

Conversation

ligurio
Copy link
Member

@ligurio ligurio commented Nov 25, 2020

No description provided.

@Totktonada
Copy link
Member

See CI on the master branch: python 3 is supported and verified. So I don't understand a problem you tries to solve.

Say, unittest.TestCase contains both assertRaisesRegexp() and assertRaisesRegex() on Python 3.7.6. Even if it would not, we don't need a library to make the simple alias. x.items() from Python 2 is the same as list(x.items()) in Python 3, but it does not meant that you need to follow py2to3 everywhere it suggest you to do so. Mostly it is just doesn't necessary and a view on a mapping object is what you need.

Please, pay attention to don't break Python 2 code.

If I'm too early here, I suggest to mark the PR as draft.

@ligurio ligurio force-pushed the ligurio/support-python3 branch 2 times, most recently from 81b5fd4 to 46c565b Compare November 25, 2020 10:34
@ligurio ligurio requested a review from Totktonada November 25, 2020 11:37
@ligurio
Copy link
Member Author

ligurio commented Nov 25, 2020

See CI on the master branch: python 3 is supported and verified. So I don't understand a problem you tries to solve.

Yep, code is actually already compatible with Python 3. There are only two places required to fix: print calls and exec call. Please review these two patches. CI is green.

Please, pay attention to don't break Python 2 code.

Sure.

In a Python 3 'print' becomes a function, see [1].
Patch makes print calls compatible with Python 3.

1. https://docs.python.org/3/whatsnew/3.0.html#print-is-a-function
exec was a statement in Python 2.x [1] and it has been converted to a function
in Python 3.x [2], change introduced in version 3.0 [3].

1. https://docs.python.org/2/reference/simple_stmts.html#exec
2. https://docs.python.org/3/library/functions.html#exec
3. https://docs.python.org/3/whatsnew/3.0.html
@ligurio ligurio force-pushed the ligurio/support-python3 branch from 46c565b to 7a870fa Compare November 27, 2020 08:42
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Totktonada Totktonada merged commit 37d5f89 into master Dec 1, 2020
@Totktonada Totktonada deleted the ligurio/support-python3 branch December 1, 2020 07:44
ligurio added a commit to tarantool/test-run that referenced this pull request Jan 16, 2021
Related issues:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Jan 18, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Jan 19, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Jan 22, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 1, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 3, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 4, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 4, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 4, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 8, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 8, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Feb 11, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 4, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 5, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 6, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 6, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 9, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 9, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 9, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 9, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 9, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 10, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 10, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 10, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 12, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
ligurio added a commit to tarantool/test-run that referenced this pull request Mar 12, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
Totktonada pushed a commit to tarantool/test-run that referenced this pull request Mar 12, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
Totktonada pushed a commit to tarantool/test-run that referenced this pull request Mar 13, 2021
Related issues and changes:

- Support Python 3 in Tarantool test suite
  tarantool/tarantool#5538
- Python 3 in tarantool-python
  tarantool/tarantool-python#181
  tarantool/tarantool-python#186
- Use Python 3 in a test infrastructure
  tarantool/tarantool#5652

Closes #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants