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.

Title: 2to3 discards comments before import statements
Type: behavior Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions:
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: collinwinter Nosy List: benjamin.peterson, collinwinter, georg.brandl, nedds
Priority: normal Keywords: patch

Created on 2008-05-16 15:37 by georg.brandl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
fix_import.diff nedds, 2008-07-18 18:29 Diff for fix_import correction
Messages (5)
msg66950 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-16 15:37
I got this diff from Tools/freeze/

-# Import the freeze-private modules
-import checkextensions
-import makeconfig
-import makefreeze
-import makemakefile
-import parsesetup
-import bkfile
+from . import checkextensions
+from . import makeconfig
+from . import makefreeze
+from . import makemakefile
+from . import parsesetup
+from . import bkfile
msg69962 - (view) Author: Nick Edds (nedds) Date: 2008-07-18 18:10
This seems to have been the same problem that was causing whitespace to
get lost before some imports. I believe the fix_import change I provided
in that issue, issue 3334, also corrects this problem.
msg69963 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-07-18 18:27
I still this problem with the latest version of 2to3.
msg69964 - (view) Author: Nick Edds (nedds) Date: 2008-07-18 18:29
Yeah sorry. I can't commit changes, so I have the diff in the other
issue but it has not yet been committed. Here it is again for redundancy.
msg70026 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-19 13:34
Duplicate of #3334.
Date User Action Args
2022-04-11 14:56:34adminsetgithub: 47143
2008-07-19 13:34:42georg.brandlsetstatus: open -> closed
resolution: duplicate
messages: + msg70026
2008-07-18 18:29:25neddssetfiles: + fix_import.diff
keywords: + patch
messages: + msg69964
2008-07-18 18:27:07benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg69963
2008-07-18 18:10:53neddssetnosy: + nedds
messages: + msg69962
2008-05-16 15:37:41georg.brandlcreate