From 3a189af4b203b9b3bd466680161b32016502defb Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 13 Mar 2025 15:22:16 +0400 Subject: gh-93096: Remove CLI interface for `difflib` (#131099) --- Doc/library/cmdline.rst | 1 - Lib/difflib.py | 7 ------- .../next/Library/2025-03-11-20-35-41.gh-issue-93096.Jdt_8a.rst | 2 ++ 3 files changed, 2 insertions(+), 8 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2025-03-11-20-35-41.gh-issue-93096.Jdt_8a.rst diff --git a/Doc/library/cmdline.rst b/Doc/library/cmdline.rst index 59629b6..a000eb2 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 c124afd..bc09aa1 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 0000000..69a261d --- /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. -- cgit v0.12