From e3b1940eb9eedb752e23310a2b846cb91a970675 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 8 May 2008 20:36:09 +0000 Subject: [PATCH] Deprecate the user module for removal in 3.0. --- Doc/library/user.rst | 2 ++ Lib/test/test_py3kwarn.py | 2 +- Lib/user.py | 3 +++ Misc/NEWS | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Doc/library/user.rst b/Doc/library/user.rst index aa09b67278c..4fdd9cf4da3 100644 --- a/Doc/library/user.rst +++ b/Doc/library/user.rst @@ -4,7 +4,9 @@ .. module:: user :synopsis: A standard way to reference user-specific modules. + :deprecated: +.. deprecated:: The user module has been removed in Python 3.0. .. index:: pair: .pythonrc.py; file diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 7e284e5a3f6..ab8e3168bdd 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -126,7 +126,7 @@ class TestPy3KWarnings(unittest.TestCase): class TestStdlibRemovals(unittest.TestCase): - all_platforms = ('audiodev', 'imputil', 'mutex') + all_platforms = ('audiodev', 'imputil', 'mutex', 'user') def check_removal(self, module_name): """Make sure the specified module, when imported, raises a diff --git a/Lib/user.py b/Lib/user.py index e550e52ad80..596f0a74628 100644 --- a/Lib/user.py +++ b/Lib/user.py @@ -20,6 +20,9 @@ The user's .pythonrc.py could conceivably test for sys.version if it wishes to do different things depending on the Python version. """ +from warnings import warnpy3k +warnpy3k("the user module has been removed in Python 3.0", stacklevel=2) +del warnpy3k import os diff --git a/Misc/NEWS b/Misc/NEWS index d51e1281bd5..5c7d304c53a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -20,6 +20,8 @@ Extension Modules Library ------- +- The user module has been deprecated for removal in Python 3.0. + - The stringold module has been deprecated for removal in Python 3.0. - The mutex module has been deprecated for removal in Python 3.0.