[Python-porting] HTMLParser in 2to3

Benjamin Peterson musiccomposition at gmail.com
Tue Dec 16 03:10:06 CET 2008


On Mon, Dec 15, 2008 at 4:44 PM, Brett Cannon <brett at python.org> wrote:
> On Mon, Dec 15, 2008 at 12:18, see <csad7 at t-online.de> wrote:
>> hi,
>> (hope this is the right forum for this kind of question...)
>>
>> While testing the 2to3 tool for a lib of mine I noticed imports for
>> HTMLParser seem not to be changed yet.
>>
>
> Please file a bug report at http://bugs.python.org so this doesn't get lost.

Don't bother filing a report; this is fixed in the 2to3 trunk:

$ ./2to3 -
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
import HTMLParser
from HTMLParser import HTMLParser
--- <stdin> (original)
+++ <stdin> (refactored)
@@ -1,2 +1,2 @@
-import HTMLParser
-from HTMLParser import HTMLParser
+import html.parser
+from html.parser import HTMLParser
RefactoringTool: Files that need to be modified:
RefactoringTool: <stdin>





-- 
Cheers,
Benjamin Peterson
"There's nothing quite as beautiful as an oboe... except a chicken
stuck in a vacuum cleaner."


More information about the Python-porting mailing list