mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +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
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue