Issue 3334: 2to3 looses indentation on import fix (original) (raw)

Issue3334

Created on 2008-07-10 16:55 by ctheune, last changed 2022-04-11 14:56 by admin. 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
2022-04-11 14:56:36 admin set github: 47584
2008-07-19 13:33:25 georg.brandl set status: open -> closednosy: + georg.brandlresolution: fixedmessages: +
2008-07-18 17:25:11 nedds set files: + fix_import.diffnosy: + neddsmessages: + keywords: + patch
2008-07-10 16:55:12 ctheune create