[New-bugs-announce] [issue6506] lib2to3 fails to convert 'thread' when not followed by a period

Eric Promislow report at bugs.python.org
Fri Jul 17 19:54:19 CEST 2009


New submission from Eric Promislow <ericp at activestate.com>:

Given this code:

import thread
print thread

$ python
ActivePython 2.6.1.1 (ActiveState Software Inc.) based on
Python 2.6.1 (r261:67515, Dec  5 2008, 13:58:38) [MSC v.1500 32 bit
(Intel)] on
win32
>>> from lib2to3.main import main
>>> print open("flip2.py").read()
import thread
print thread

>>> main('lib2to3.fixes', ['flip2.py'])
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
--- flip2.py (original)
+++ flip2.py (refactored)
@@ -1,2 +1,2 @@
-import thread
-print thread
+import _thread
+print(thread)
RefactoringTool: Files that need to be modified:
RefactoringTool: flip2.py
0

Note how "thread" in the print statement is not converted.

----------
components: 2to3 (2.x to 3.0 conversion tool)
messages: 90635
nosy: ericp
severity: normal
status: open
title: lib2to3 fails to convert 'thread' when not followed by a period
type: behavior
versions: Python 2.6

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


More information about the New-bugs-announce mailing list