From 4c63939585f128ccbc3acd31665c7b1c79ea6165 Mon Sep 17 00:00:00 2001 From: Augusto Hack Date: Tue, 17 Sep 2019 13:15:27 +0200 Subject: [PATCH] setprofile accepts None (#3239) The function `threading.setprofile` can be called with a `None` value to clear the profile function. This does unset the function from the existing threads, it only clears the callback function so that new threads are created without the profiling hook installed. --- stdlib/2and3/threading.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/threading.pyi b/stdlib/2and3/threading.pyi index 63f838f3d..b5d8f0d35 100644 --- a/stdlib/2and3/threading.pyi +++ b/stdlib/2and3/threading.pyi @@ -30,7 +30,7 @@ if sys.version_info >= (3, 4): def main_thread() -> Thread: ... def settrace(func: _TF) -> None: ... -def setprofile(func: _PF) -> None: ... +def setprofile(func: Optional[_PF]) -> None: ... def stack_size(size: int = ...) -> int: ... if sys.version_info >= (3,):