Skip to content

Commit 604f25b

Browse files
committed
Do not deprecate getargs() yet
1 parent 20875cb commit 604f25b

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

Lib/inspect.py

-8
Original file line numberDiff line numberDiff line change
@@ -1364,14 +1364,6 @@ def getargs(co):
13641364
'args' is the list of argument names. Keyword-only arguments are
13651365
appended. 'varargs' and 'varkw' are the names of the * and **
13661366
arguments or None."""
1367-
import warnings
1368-
warnings.warn(
1369-
'getargs is deprecated since Python3.13, '
1370-
'use Signature.from_code instead',
1371-
DeprecationWarning,
1372-
stacklevel=2,
1373-
)
1374-
13751367
if not iscode(co):
13761368
raise TypeError('{!r} is not a code object'.format(co))
13771369

Lib/test/test_inspect.py

-19
Original file line numberDiff line numberDiff line change
@@ -435,25 +435,6 @@ class ConcreteGrandchild(ClassExample):
435435
self.assertEqual(isabstract_checks, [True, True, False])
436436

437437

438-
class TestGetArgs(unittest.TestCase):
439-
def test_getargs_is_deprecated(self):
440-
# We are only interested in the deprecation warning,
441-
# because `getargs` is:
442-
# - undocumented
443-
# - untested
444-
# - deprecated
445-
# - has modern alternative
446-
# - incorrect anyways.
447-
def func(): ...
448-
449-
msg = (
450-
'getargs is deprecated since Python3.13, '
451-
'use Signature.from_code instead'
452-
)
453-
with self.assertWarnsRegex(DeprecationWarning, msg):
454-
inspect.getargs(func.__code__)
455-
456-
457438
class TestInterpreterStack(IsTestBase):
458439
def __init__(self, *args, **kwargs):
459440
unittest.TestCase.__init__(self, *args, **kwargs)

0 commit comments

Comments
 (0)