On Fri, Dec 12, 2008 at 11:39 AM, Lennart Regebro <rege...@gmail.com> wrote:
> The fix_imports fix seems to fix only the first import per line that you have.
> So if you do for example
>   import urllib2, cStringIO
> it will not fix cStringIO.
>
> Is this a bug or a feature? :-) If it's a feature it should warn at
> least, right?
>

Which revision of python are you using? I tried the test-case you gave
and 2to3 translated it perfectly.

-- Alexandre

a...@helios:~$ cat test.py
import urllib2, cStringIO

s = cStringIO.StringIO(urllib2.randombytes(100))
a...@helios:~$ 2to3 test.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
--- test.py (original)
+++ test.py (refactored)
@@ -1,3 +1,3 @@
-import urllib2, cStringIO
+import urllib.request, urllib.error, io

-s = cStringIO.StringIO(urllib2.randombytes(100))
+s = io.StringIO(urllib2.randombytes(100))
RefactoringTool: Files that need to be modified:
RefactoringTool: test.py
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to