[New-bugs-announce] [issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

Mitchell Model report at bugs.python.org
Wed May 27 22:56:12 CEST 2009


New submission from Mitchell Model <mlm at acm.org>:

2to3 changes "import m" to "from . import m" but it doesn't change
"import sub.s".

The directory q.py is in has a file m.py and a subdirectory sub.
The subdirectory sub has a file s.py.
File q.py contains two lines:

import m
import sub.s

% 2to3 -f q.py
--- q.py (original)
+++ q.py (refactored)
@@ -1,2 +1,2 @@
-import m
+from . import m
 import sub.s
RefactoringTool: Files that need to be modified:
RefactoringTool: q.py

----------
messages: 88444
nosy: MLModel
severity: normal
status: open
title: 2to3 does not convert imports of the form 'import sub.mod' to relative import

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6129>
_______________________________________


More information about the New-bugs-announce mailing list