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.
This commit is contained in:
karl ding
2020-06-05 07:40:51 -07:00
committed by GitHub
parent db819480a5
commit 3f141751d7

View File

@@ -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: ...