Skip to content
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

Python 3 compatiblity #887

Merged
merged 38 commits into from
Feb 25, 2018
Merged

Python 3 compatiblity #887

merged 38 commits into from
Feb 25, 2018

Conversation

hroncok
Copy link
Collaborator

@hroncok hroncok commented Feb 11, 2018

See #882

Depends on #886

@hroncok hroncok mentioned this pull request Feb 11, 2018
4 tasks
@hroncok
Copy link
Collaborator Author

hroncok commented Feb 12, 2018

This mostly works for me, but I still haven't tried to print anything. That has to wait for tmrw.

I'm still expecting to be bitten by more true division and bytes vs str mishmashs.

@hroncok
Copy link
Collaborator Author

hroncok commented Feb 12, 2018

I can print!

@hroncok hroncok changed the title WIP: Python 3 compatiblity Python 3 compatiblity Feb 12, 2018
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_except
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_print
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_tuple_params

And fixed up manually.
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_import
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_imports
Instead, make sure the encoding of our locale is UTF-8
Initialy converted by:

    python-modernize -wnf lib2to3.fixes.fix_map

Went trough the changes manually, used comprehensions where possible.
Initialy converted by:

    python-modernize -wnf lib2to3.fixes.fix_filter

Done manual changes.
Initially done by:

    python-modernize -wnf lib2to3.fixes.fix_unicode

Removed the u"" -> "" change.
Change generated by:

    python-modernize -wnf lib2to3.fixes.fix_exec
Initally fixed by:

    find printrun -name '*.py' -type f -exec bash -c 'T=$(mktemp); expand -i -t 8 "$0" > "$T" && mv "$T" "$0"' {} \;

Then fixed printrun/serialWrapper.py manually from 8 spaces indent to 4.
Initially with:

    python-modernize -wnf lib2to3.fixes.fix_xrange

Went trough the changes and removed some unnecessary.
Done manually, the fixer didn't work.
By:

    python-modernize -wnf lib2to3.fixes.fix_itertools

Removed unused itertools import manually.
Fixed by:

    python-modernize -wnf lib2to3.fixes.fix_raw_input
Fixed by:

    python-modernize -wnf lib2to3.fixes.fix_next
Initially by:

    python-modernize -wnf lib2to3.fixes.fix_dict

Manually removed where not needed.
Converted automatically by:

    python-modernize -wnf lib2to3.fixes.fix_idioms
Initially by:

    python-modernize -wnf lib2to3.fixes.fix_reduce

Then reorganized the import a bit manually.
Automated by:

    python-modernize -wnf lib2to3.fixes.fix_set_literal
Automatically by:

    python-modernize -wnf lib2to3.fixes.fix_unicode

This fixer also renames unicode to str, which was done before.
Done by:

    sed -i 's/(object):/:/g' $(git grep --name-only '(object)')
Also, import it properly, as it was not cythonized before and was not caught
by the lib2to3 import fixer.
 * convert to python3
 * only have shebangs + exec bits in files that have something to execute
@rockstorm101 rockstorm101 changed the base branch from master to 2.x February 25, 2018 07:53
@rockstorm101 rockstorm101 merged commit 921794c into kliment:2.x Feb 25, 2018
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