Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-38681: Enhance 2to3 conversion for blank line#17096

Closed
samtatasurya wants to merge 8 commits into
python:mainpython/cpython:mainfrom
samtatasurya:fix-issue-38681samtatasurya/cpython:fix-issue-38681Copy head branch name to clipboard
Closed

bpo-38681: Enhance 2to3 conversion for blank line#17096
samtatasurya wants to merge 8 commits into
python:mainpython/cpython:mainfrom
samtatasurya:fix-issue-38681samtatasurya/cpython:fix-issue-38681Copy head branch name to clipboard

Conversation

@samtatasurya

@samtatasurya samtatasurya commented Nov 9, 2019

Copy link
Copy Markdown

Main changes

  1. Added a new helper function BlankLineOrPass, which replaces BlankLine in fix_future.py and fix_itertools_imports.py.
  2. Added optional keyword argument reformat to FixerTestCase.check function in test_fixers.py.

Example 1
Code to be converted:

try:
    from __future__ import with_statement
except ImportError:
    pass

Before enhancement:

 try:
-    from __future__ import with_statement
+    
 except ImportError:
     pass

After enhancement:

 try:
-    from __future__ import with_statement
+    pass
 except ImportError:
     pass

Example 2
Code to be converted:

if sys.version_info < (3, 0):
    from itertools import imap

Before enhancement:

 if sys.version_info < (3, 0):
-    from itertools import imap
+

After enhancement:

 if sys.version_info < (3, 0):
-    from itertools import imap
+    pass

https://bugs.python.org/issue38681

Samuel Tatasurya added 4 commits November 6, 2019 00:17
…d future and itertools_imports fixers to use BlankLineOrPass instead of BlankLine.
…d future and itertools_imports fixers to use BlankLineOrPass instead of BlankLine.
@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@samtatasurya

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@isidentical isidentical left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great

Comment thread Lib/lib2to3/fixer_util.py Outdated
Comment thread Misc/NEWS.d/next/Library/2019-11-09-06-16-24.bpo-38681.jJobMS.rst Outdated
@isidentical isidentical requested a review from pablogsal March 8, 2020 05:37
@iritkatriel

iritkatriel commented Oct 20, 2021

Copy link
Copy Markdown
Member

The issue was closed under bpo-45544 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.