summaryrefslogtreecommitdiff
path: root/Lib/trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/trace.py')
-rwxr-xr-xLib/trace.py18
1 files changed, 1 insertions, 17 deletions
diff --git a/Lib/trace.py b/Lib/trace.py
index 62325d3f23..681c3f9d05 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -451,22 +451,7 @@ class Trace:
sys.settrace(None)
threading.settrace(None)
- def runfunc(*args, **kw):
- if len(args) >= 2:
- self, func, *args = args
- elif not args:
- raise TypeError("descriptor 'runfunc' of 'Trace' object "
- "needs an argument")
- elif 'func' in kw:
- func = kw.pop('func')
- self, *args = args
- import warnings
- warnings.warn("Passing 'func' as keyword argument is deprecated",
- DeprecationWarning, stacklevel=2)
- else:
- raise TypeError('runfunc expected at least 1 positional argument, '
- 'got %d' % (len(args)-1))
-
+ def runfunc(self, func, /, *args, **kw):
result = None
if not self.donothing:
sys.settrace(self.globaltrace)
@@ -476,7 +461,6 @@ class Trace:
if not self.donothing:
sys.settrace(None)
return result
- runfunc.__text_signature__ = '($self, func, /, *args, **kw)'
def file_module_function_of(self, frame):
code = frame.f_code