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

Change py2-style print stmts to py3 #2429

Merged
merged 3 commits into from
Jan 28, 2020
Merged

Conversation

cphyc
Copy link
Member

@cphyc cphyc commented Jan 28, 2020

PR Summary

Many docstrings as well as cython code were still using Python 2-style prints (without parenthesis). This PR fixes this.

It relies on the following sed expression

sed -i 's/print \([^(].*[^\\]$/print(\1)/g' **/*.{py,pyx,pxd}

with some human-based post-processing. Indeed, this regexp is unable to find multi-line print statement, which are found in particular in Cython files.

PR Checklist

  • Code passes flake8 checker

Copy link
Member

@munkm munkm left a comment

Choose a reason for hiding this comment

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

Thanks for getting these!

@munkm munkm merged commit 816301c into yt-project:yt-4.0 Jan 28, 2020
@cphyc cphyc deleted the python3-prints branch January 28, 2020 22:25
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.

4 participants