This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2019年11月04日 07:12 by Samuel Tatasurya, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 17096 | closed | python-dev, 2019年11月09日 05:52 | |
| Messages (1) | |||
|---|---|---|---|
| msg355926 - (view) | Author: Samuel Tatasurya (Samuel Tatasurya) | Date: 2019年11月04日 07:12 | |
Transformation performed by certain fixers (e.g. future, itertools_imports) that causes a statement to be replaced by a blank line will generate a Python file that contains syntax error. For example, assuming a Python file (foo.py) containing line below: try: from itertools import imap except ImportError: pass If we run "itertools_imports" fixer against it: 2to3 -f itertools_imports foo.py will result in the following: try: except ImportError: pass which is syntactically incorrect. Suggestion: Instead of always replacing such case with BlankLine(), a check should be performed beforehand if the statement to be replaced has any siblings. If no sibling is found, then replace that statement with a "pass" statement instead. By doing this, Python source files generated by 2to3 are more readily runnable right after the transformation. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:22 | admin | set | github: 82862 |
| 2021年10月20日 22:56:56 | iritkatriel | set | status: open -> closed superseder: Close 2to3 issues and list them here resolution: wont fix stage: patch review -> resolved |
| 2020年01月18日 03:15:58 | cheryl.sabella | link | issue39331 superseder |
| 2019年11月09日 05:52:30 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request16602 |
| 2019年11月08日 23:31:00 | terry.reedy | set | nosy:
+ benjamin.peterson |
| 2019年11月04日 07:12:47 | Samuel Tatasurya | create | |