From 3f141751d7bd7a69514cf82b331caeede7b9835d Mon Sep 17 00:00:00 2001 From: karl ding Date: Fri, 5 Jun 2020 07:40:51 -0700 Subject: [PATCH] cProfile: Fix Profile __init__ keyword arguments (#4183) The CPython _lsprof module implementation uses the keyword arguments 'timer' and 'timeunit' instead of 'custom_timer' and 'time_unit' for __init__. In profiler_init, the keyword argument parsing looks like the following: static char *kwlist[] = {"timer", "timeunit", "subcalls", "builtins", 0}; This is the case ever since _lsprof was added in version 2.5. --- stdlib/2and3/cProfile.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/cProfile.pyi b/stdlib/2and3/cProfile.pyi index c6a11721d..209268006 100644 --- a/stdlib/2and3/cProfile.pyi +++ b/stdlib/2and3/cProfile.pyi @@ -13,7 +13,7 @@ else: _Path = Union[bytes, Text] class Profile: - def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... + def __init__(self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... def print_stats(self, sort: Union[str, int] = ...) -> None: ...