Message101636
| Author |
Robert.Kern |
| Recipients |
Robert.Kern |
| Date |
2010年03月24日.15:06:17 |
| SpamBayes Score |
7.641804e-06 |
| Marked as misclassified |
No |
| Message-id |
<1269443180.02.0.978577516398.issue8221@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
When a module inside a package imports StringIO from cStringIO, it should change that to "from io import StringIO". However, if there is a module inside the package named io.py, 2to3 changes it to "from .io import StringIO".
[bug23]$ tree
.
`-- package
|-- __init__.py
|-- helper.py
`-- io.py
1 directory, 3 files
[bug23]$ cat package/helper.py
from cStringIO import StringIO
[bug23]$ 2to3 package
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
--- package/helper.py (original)
+++ package/helper.py (refactored)
@@ -1,1 +1,1 @@
-from cStringIO import StringIO
+from .io import StringIO
RefactoringTool: Files that need to be modified:
RefactoringTool: package/helper.py |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年03月24日 15:06:20 | Robert.Kern | set | recipients:
+ Robert.Kern |
| 2010年03月24日 15:06:20 | Robert.Kern | set | messageid: <1269443180.02.0.978577516398.issue8221@psf.upfronthosting.co.za> |
| 2010年03月24日 15:06:17 | Robert.Kern | link | issue8221 messages |
| 2010年03月24日 15:06:17 | Robert.Kern | create |
|