]> granicus.if.org Git - python/commitdiff
Deprecate the new module for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Fri, 9 May 2008 05:18:40 +0000 (05:18 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 9 May 2008 05:18:40 +0000 (05:18 +0000)
Doc/library/new.rst
Lib/new.py
Lib/test/test_new.py
Lib/test/test_py3kwarn.py
Misc/NEWS

index 1858009075cf7398d4f6999533fdbc4ccd1a452e..25eb33e4429bc48f045c48d334ca9487d5bd02b2 100644 (file)
@@ -4,6 +4,10 @@
 
 .. module:: new
    :synopsis: Interface to the creation of runtime implementation objects.
+   :deprecated:
+
+.. deprecated:: The new module has been removed in Python 3.0.
+
 .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
 
 
index 1a5c11f2f3446cade653014ff43034e653b4a9af..e5f964f87e007f591be4a4ccda333f0bebe8f943 100644 (file)
@@ -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
index c243b59e91bc93637759c32701cfa976184c22f5..231f4bb745ba1155b2aecc3b9a690e9fc16f95cf 100644 (file)
@@ -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):
index dd7c765025cb98c685c15f02c539b0c613957192..09333824bc488c672c20dac5d0f008eb28879024 100644 (file)
@@ -126,7 +126,7 @@ class TestPy3KWarnings(unittest.TestCase):
 
 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
index a4f886b36fcf1c379b60cc13150192c4868d8c88..08d36c40dffb89bf0d34ea287d33248cfc527f45 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,8 @@ Extension Modules
 Library
 -------
 
+- The new module has been deprecated for removal in Python 3.0.
+
 - The user module has been deprecated for removal in Python 3.0.
 
 - The stringold module has been deprecated for removal in Python 3.0.