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.

Author alexandre.vassalotti
Recipients alexandre.vassalotti, benjamin.peterson
Date 2009-07-06.17:13:13
SpamBayes Score 0.0003482475
Marked as misclassified No
Message-id <1246900395.55.0.0522093786653.issue6429@psf.upfronthosting.co.za>
In-reply-to
Content
Running 2to3 with the default options on the following code:

  from __future__ import print_function
  x,y = 1,2
  print(x, y)

produces the following diff:

  --- future_print.py (original)
  +++ future_print.py (refactored)
  @@ -1,5 +1,5 @@
  -from __future__ import print_function
  +
  
   x = 1
   y = 2
  -print(x, y)
  +print((x, y))

If the "--nofix=future" options is specified, 2to3 produces the correct
output.

I found this while working on a fixer for removing future_builtins
imports. It seems that fixer_util.does_tree_import() is unable to find
the __future__ import node and thus causes FixPrint to be run instead of
being skipped.
History
Date User Action Args
2009-07-06 17:13:15alexandre.vassalottisetrecipients: + alexandre.vassalotti, benjamin.peterson
2009-07-06 17:13:15alexandre.vassalottisetmessageid: <1246900395.55.0.0522093786653.issue6429@psf.upfronthosting.co.za>
2009-07-06 17:13:14alexandre.vassalottilinkissue6429 messages
2009-07-06 17:13:13alexandre.vassalotticreate