From: donBarbos Date: Thu, 13 Mar 2025 11:22:16 +0000 (+0400) Subject: gh-93096: Remove CLI interface for `difflib` (#131099) X-Git-Tag: v3.14.0a6~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a189af4b203b9b3bd466680161b32016502defb;p=thirdparty%2FPython%2Fcpython.git gh-93096: Remove CLI interface for `difflib` (#131099) --- diff --git a/Doc/library/cmdline.rst b/Doc/library/cmdline.rst index 59629b693ba0..a000eb21845b 100644 --- a/Doc/library/cmdline.rst +++ b/Doc/library/cmdline.rst @@ -11,7 +11,6 @@ The following modules have a command-line interface. * :mod:`code` * :ref:`compileall ` * :mod:`cProfile`: see :ref:`profile ` -* :ref:`difflib ` * :ref:`dis ` * :mod:`doctest` * :mod:`!encodings.rot_13` diff --git a/Lib/difflib.py b/Lib/difflib.py index c124afdd0395..bc09aa128aa6 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -2060,10 +2060,3 @@ def restore(delta, which): for line in delta: if line[:2] in prefixes: yield line[2:] - -def _test(): - import doctest, difflib - return doctest.testmod(difflib) - -if __name__ == "__main__": - _test() diff --git a/Misc/NEWS.d/next/Library/2025-03-11-20-35-41.gh-issue-93096.Jdt_8a.rst b/Misc/NEWS.d/next/Library/2025-03-11-20-35-41.gh-issue-93096.Jdt_8a.rst new file mode 100644 index 000000000000..69a261d558ba --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-03-11-20-35-41.gh-issue-93096.Jdt_8a.rst @@ -0,0 +1,2 @@ +Removed undocumented CLI ``python -m difflib``. Use ``python -m doctest +Lib/difflib.py -v`` instead. Patch by Semyon Moroz.