[issue35417] Double parenthesis in print function running 2to3 in already correct call

Karthikeyan Singaravelan report at bugs.python.org
Wed Dec 5 07:33:08 EST 2018


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Thanks for the report. Is this similar to issue10375 ? One option would be to use -p to stop transforming print related code if you don't want to transform any print statement.


$ cat /tmp/foo.py
print (1)

$ 2to3 /tmp/foo.py
[snip]
--- /tmp/foo.py	(original)
+++ /tmp/foo.py	(refactored)
@@ -1 +1 @@
-print (1)
+print((1))

$ 2to3 -p /tmp/foo.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No files need to be modified.

----------
nosy: +benjamin.peterson, xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35417>
_______________________________________


More information about the Python-bugs-list mailing list