]> granicus.if.org Git - python/commitdiff
Deprecated the mhlib module for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Sun, 11 May 2008 03:01:47 +0000 (03:01 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 11 May 2008 03:01:47 +0000 (03:01 +0000)
Doc/library/mhlib.rst
Lib/mhlib.py
Lib/test/test_mhlib.py
Lib/test/test_py3kwarn.py
Lib/test/test_pyclbr.py
Misc/NEWS

index f6edf289c4015ce1e6ffbd01c6f41a78a468c645..2a6a2dbd7df3f95ea29d10b0c09a4a91dfcb3c86 100644 (file)
@@ -3,6 +3,12 @@
 
 .. module:: mhlib
    :synopsis: Manipulate MH mailboxes from Python.
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The :mod:`mhlib` module has been removed in Python 3.0. Use the
+    :mod:`mailbox` instead.
+
 .. sectionauthor:: Skip Montanaro <skip@pobox.com>
 
 The :mod:`mhlib` module provides a Python interface to MH folders and their
index 1a90375210332e432eaedf9ccf559b0e844a3bad..856e87804cd968ca90a21e27c5be22e30236c1ce 100644 (file)
@@ -52,6 +52,10 @@ s = m.getheadertext(pred) # text of message's headers, filtered by pred
 s = m.getbodytext()     # text of message's body, decoded
 s = m.getbodytext(0)    # text of message's body, not decoded
 """
+from warnings import warnpy3k
+warnpy3k("the mhlib module has been removed in Python 3.0; use the mailbox "
+            "module instead", stacklevel=2)
+del warnpy3k
 
 # XXX To do, functionality:
 # - annotate messages
index a6dc00ad929500782b968556df6d1aa175f952ea..04571ea3f640dd426d1c2fa2ca5e854d57d140df 100644 (file)
@@ -7,10 +7,10 @@
 ###      mhlib.  It should.
 
 import unittest
-from test.test_support import run_unittest, TESTFN, TestSkipped
+from test.test_support import run_unittest, TESTFN, TestSkipped, import_module
 import os, StringIO
 import sys
-import mhlib
+mhlib = import_module('mhlib', deprecated=True)
 
 if (sys.platform.startswith("win") or sys.platform=="riscos" or
       sys.platform.startswith("atheos")):
index 6835fa8efe2427720de8eef0127e325d60380beb..13c0ec37bb33026c2ff8a01e343b5259284c31da 100644 (file)
@@ -130,7 +130,7 @@ class TestStdlibRemovals(unittest.TestCase):
     # import side-effect.
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
                         'Bastion', 'compiler', 'dircache', 'fpformat',
-                        'ihooks')
+                        'ihooks', 'mhlib')
     inclusive_platforms = {'irix':('pure',)}
     # XXX Don't know if lib-tk is only installed if _tkinter is built.
     optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev')
index d747f2f682468a2d9b23f527d70e5797f73bdfab..3617edf133c425c4870d7df1269d1025adb36b4a 100644 (file)
@@ -164,7 +164,6 @@ class PyclbrTest(TestCase):
         # These were once about the 10 longest modules
         cm('random', ignore=('Random',))  # from _random import Random as CoreGenerator
         cm('cgi', ignore=('log',))      # set with = in module
-        cm('mhlib')
         cm('urllib', ignore=('getproxies_registry',
                              'proxy_bypass_registry',
                              'open_https',
index 9471c52bbdccae3b39d58dad3dfe80240a9c8a9e..d796735e2c3af39789748ae7ea33e6f25208a10c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Extension Modules
 Library
 -------
 
+- The mhlib module has been deprecated for removal in Python 3.0.
+
 - The linuxaudiodev module has been deprecated for removal in Python 3.0.
 
 - The ihooks module has been deprecated for removal in Python 3.0.