summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2008-05-17 20:30:04 +0000
committerFred Drake <fdrake@acm.org>2008-05-17 20:30:04 +0000
commit91ae2502739ecfcc7a8a013473553224b8387521 (patch)
tree670ee16e6d1ad3722b0cdefe145408b162396566 /Lib
parentc6d64ec83fd6bb170725a04409d8383a53559c95 (diff)
downloadcpython-git-91ae2502739ecfcc7a8a013473553224b8387521.tar.gz
rename HTMLParser to html.parser, htmlentitydefs to html.entities
(http://bugs.python.org/issue2882)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/html/__init__.py1
-rw-r--r--Lib/html/entities.py (renamed from Lib/htmlentitydefs.py)0
-rw-r--r--Lib/html/parser.py (renamed from Lib/HTMLParser.py)0
-rw-r--r--Lib/lib-old/HTMLParser.py8
-rw-r--r--Lib/lib-old/htmlentitydefs.py8
-rw-r--r--Lib/test/test_py3kwarn.py2
6 files changed, 19 insertions, 0 deletions
diff --git a/Lib/html/__init__.py b/Lib/html/__init__.py
new file mode 100644
index 0000000000..196d378857
--- /dev/null
+++ b/Lib/html/__init__.py
@@ -0,0 +1 @@
+# This directory is a Python package.
diff --git a/Lib/htmlentitydefs.py b/Lib/html/entities.py
index 3dd14a79fa..3dd14a79fa 100644
--- a/Lib/htmlentitydefs.py
+++ b/Lib/html/entities.py
diff --git a/Lib/HTMLParser.py b/Lib/html/parser.py
index 2cbc2ecbc7..2cbc2ecbc7 100644
--- a/Lib/HTMLParser.py
+++ b/Lib/html/parser.py
diff --git a/Lib/lib-old/HTMLParser.py b/Lib/lib-old/HTMLParser.py
new file mode 100644
index 0000000000..ae42e0f0a5
--- /dev/null
+++ b/Lib/lib-old/HTMLParser.py
@@ -0,0 +1,8 @@
+from warnings import warnpy3k
+
+warnpy3k(("The HTMLParser module has been renamed to html.parser"
+ " in Python 3.0"), stacklevel=2)
+
+from sys import modules
+import html.parser
+modules["HTMLParser"] = html.parser
diff --git a/Lib/lib-old/htmlentitydefs.py b/Lib/lib-old/htmlentitydefs.py
new file mode 100644
index 0000000000..340b6234ed
--- /dev/null
+++ b/Lib/lib-old/htmlentitydefs.py
@@ -0,0 +1,8 @@
+from warnings import warnpy3k
+
+warnpy3k(("The htmlentitydefs module has been renamed to html.entities"
+ " in Python 3.0"), stacklevel=2)
+
+from sys import modules
+import html.entities
+modules["htmlentitydefs"] = html.entities
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 2c8f509e60..1a65323e4c 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -209,11 +209,13 @@ class TestStdlibRemovals(unittest.TestCase):
class TestStdlibRenames(unittest.TestCase):
renames = {'copy_reg': 'copyreg', 'Queue': 'queue',
+ 'htmlentitydefs': 'html.entities',
'SocketServer': 'socketserver',
'ConfigParser': 'configparser',
'repr': 'reprlib',
'FileDialog': 'tkinter.filedialog',
'FixTk': 'tkinter._fix',
+ 'HTMLParser': 'html.parser',
'ScrolledText': 'tkinter.scrolledtext',
'SimpleDialog': 'tkinter.simpledialog',
'Tix': 'tkinter.tix',