Deprecate the new module for removal in 3.0.
diff --git a/Lib/new.py b/Lib/new.py
index 1a5c11f..e5f964f 100644
--- a/Lib/new.py
+++ b/Lib/new.py
@@ -3,9 +3,10 @@
This module is no longer required except for backward compatibility.
Objects of most types can now be created by calling the type object.
"""
-from warnings import warnpy3k as _warnpy3k
-_warnpy3k("The 'new' module is not supported in 3.x, use the 'types' module "
- "instead.", stacklevel=2)
+from warnings import warnpy3k
+warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
+ "module instead.", stacklevel=2)
+del warnpy3k
from types import ClassType as classobj
from types import FunctionType as function
diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
index c243b59..231f4bb 100644
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -1,6 +1,7 @@
import unittest
from test import test_support
-import sys, new
+import sys
+new = test_support.import_module('new', deprecated=True)
class NewTest(unittest.TestCase):
def test_spam(self):
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index dd7c765..0933382 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -126,7 +126,7 @@
class TestStdlibRemovals(unittest.TestCase):
- all_platforms = ('audiodev', 'imputil', 'mutex', 'user')
+ all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new')
def check_removal(self, module_name):
"""Make sure the specified module, when imported, raises a