classification
Title: 2to3 looses indentation on import fix
Type: Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: collinwinter Nosy List: collinwinter, ctheune, georg.brandl, nedds
Priority: normal Keywords: patch

Created on 2008-07-10 16:55 by ctheune, last changed 2008-07-19 13:33 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
fix_import.diff nedds, 2008-07-18 17:25 Diff for fix_import correction
Messages (3)
msg69510 - (view) Author: Christian Theune (ctheune) * Date: 2008-07-10 16:55
I got this output from 2to3:

(This is from setuptools egg_info.py)

-        import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
+from . import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
msg69959 - (view) Author: Nick Edds (nedds) Date: 2008-07-18 17:25
I believe the problem was that in the case of this fix, rather than
using set_prefix to give the new node the same prefix as before,
new.prefix = was used. Here is the one line fix which preserves the
prefix in the example given.
msg70024 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-19 13:33
Your patch works, so I applied it and added a test in sandbox r65137.
History
Date User Action Args
2008-07-19 13:33:25georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
resolution: fixed
messages: + msg70024
2008-07-18 17:25:11neddssetfiles: + fix_import.diff
nosy: + nedds
messages: + msg69959
keywords: + patch
2008-07-10 16:55:12ctheunecreate