mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-104992: Remove deprecated unittest.TestProgram.usageExit (#104993)
This commit is contained in:
parent
897e716d03
commit
b225c08de8
4 changed files with 8 additions and 11 deletions
|
@ -256,11 +256,16 @@ Removed
|
|||
or `python-magic <https://pypi.org/project/python-magic/>`_ instead.
|
||||
(Contributed by Victor Stinner in :gh:`104773`.)
|
||||
|
||||
* Remove the untested and undocumented :meth:`!unittest.TestProgram.usageExit`
|
||||
method, deprecated in Python 3.11.
|
||||
(Contributed by Hugo van Kemenade in :gh:`104992`.)
|
||||
|
||||
* Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The
|
||||
third-party Tix library which the module wrapped is unmaintained.
|
||||
(Contributed by Zachary Ware in :gh:`75552`.)
|
||||
|
||||
|
||||
|
||||
Porting to Python 3.13
|
||||
======================
|
||||
|
||||
|
|
|
@ -104,16 +104,6 @@ class TestProgram(object):
|
|||
self.parseArgs(argv)
|
||||
self.runTests()
|
||||
|
||||
def usageExit(self, msg=None):
|
||||
warnings.warn("TestProgram.usageExit() is deprecated and will be"
|
||||
" removed in Python 3.13", DeprecationWarning)
|
||||
if msg:
|
||||
print(msg)
|
||||
if self._discovery_parser is None:
|
||||
self._initArgParsers()
|
||||
self._print_help()
|
||||
sys.exit(2)
|
||||
|
||||
def _print_help(self, *args, **kwargs):
|
||||
if self.module is None:
|
||||
print(self._main_parser.format_help())
|
||||
|
|
|
@ -1038,7 +1038,7 @@ Add optional parameter *dir_fd* in :func:`shutil.rmtree`.
|
|||
.. nonce: AixHW7
|
||||
.. section: Library
|
||||
|
||||
:meth:`~unittest.TestProgram.usageExit` is marked deprecated, to be removed
|
||||
:meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed
|
||||
in 3.13.
|
||||
|
||||
..
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Remove the untested and undocumented :meth:`!unittest.TestProgram.usageExit`
|
||||
method, deprecated in Python 3.11. Patch by Hugo van Kemenade.
|
Loading…
Add table
Add a link
Reference in a new issue