Issue12864
Created on 2011-08-30 21:59 by simohe, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg143237 - (view) | Author: simohe (simohe) | Date: 2011-08-30 21:59 | |
When the current module is in a package and imports submodules, the following lines are converted to illegal code. -import sub.subsub +from . import sub.subsub -import sub, sub.subsub, sub2 +from . import sub, sub.subsub, sub2 A valid alternative: -import sub.subsub +from .sub import subsub as _dummy -import sub, sub.subsub, sub2 +from . import sub, sub2\nfrom .sub import subsub as _dummy |
|||
| msg156737 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2012-03-25 07:03 | |
-import sub.subsub +from .sub import subsub as _dummy That’s partly incorrect, as you need to bind the name sub to match the original code. |
|||
| msg156738 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2012-03-25 07:04 | |
BTW I think if this is too difficult to implement 2to3 could just be documented as requiring you not to use implicit relative imports. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:21 | admin | set | github: 57073 |
| 2021-10-20 22:40:51 | iritkatriel | set | resolution: duplicate -> wont fix |
| 2021-10-20 22:37:18 | iritkatriel | set | status: open -> closed superseder: Close 2to3 issues and list them here resolution: duplicate stage: needs patch -> resolved |
| 2012-03-30 02:00:41 | meador.inge | set | nosy:
+ meador.inge |
| 2012-03-25 07:04:17 | eric.araujo | set | messages: + msg156738 |
| 2012-03-25 07:03:35 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg156737 |
| 2011-09-02 16:59:43 | eric.araujo | set | nosy:
+ benjamin.peterson stage: needs patch versions: + Python 2.7, Python 3.2, Python 3.3, - Python 2.6, Python 3.1 |
| 2011-08-30 21:59:21 | simohe | create | |
