Skip to content

Commit 108bb58

Browse files
committed
Remove some code duplication from html.parser and html.entities
1 parent 2e9c8bb commit 108bb58

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/html/entities.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
if PY3:
55
from html.entities import *
66
else:
7-
__future_module__ = True
8-
from htmlentitydefs import *
7+
from future.moves.html.entities import *

src/html/parser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import absolute_import
2-
from future.utils import PY3
2+
import sys
3+
__future_module__ = True
34

4-
if PY3:
5-
from html.parser import *
5+
if sys.version_info[0] == 3:
6+
raise ImportError('Cannot import module from python-future source folder')
67
else:
7-
__future_module__ = True
8-
from HTMLParser import *
8+
from future.moves.html.parser import *

0 commit comments

Comments
 (0)