Skip to content

Commit 9b22f1e

Browse files
Make keyword only
1 parent cc9e9ab commit 9b22f1e

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

Lib/profiling/sampling/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(self, pid, sample_interval_usec, all_threads, *, mode=PROFILING_MOD
154154
self.total_samples = 0
155155
self.realtime_stats = False
156156

157-
def sample(self, collector, async_aware, duration_sec=10):
157+
def sample(self, collector, duration_sec=10, *, async_aware=False):
158158
sample_interval_sec = self.sample_interval_usec / 1_000_000
159159
running_time = 0
160160
num_samples = 0

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,8 @@ def test_cli_module_argument_parsing(self):
21652165
show_summary=True,
21662166
output_format="pstats",
21672167
realtime_stats=False,
2168-
mode=0
2168+
mode=0,
2169+
async_aware=False
21692170
)
21702171

21712172
@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
@@ -2193,7 +2194,8 @@ def test_cli_module_with_arguments(self):
21932194
show_summary=True,
21942195
output_format="pstats",
21952196
realtime_stats=False,
2196-
mode=0
2197+
mode=0,
2198+
async_aware=False
21972199
)
21982200

21992201
@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
@@ -2221,7 +2223,8 @@ def test_cli_script_argument_parsing(self):
22212223
show_summary=True,
22222224
output_format="pstats",
22232225
realtime_stats=False,
2224-
mode=0
2226+
mode=0,
2227+
async_aware=False
22252228
)
22262229

22272230
@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
@@ -2321,7 +2324,8 @@ def test_cli_module_with_profiler_options(self):
23212324
show_summary=True,
23222325
output_format="pstats",
23232326
realtime_stats=False,
2324-
mode=0
2327+
mode=0,
2328+
async_aware=False
23252329
)
23262330

23272331
@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
@@ -2355,7 +2359,8 @@ def test_cli_script_with_profiler_options(self):
23552359
show_summary=True,
23562360
output_format="collapsed",
23572361
realtime_stats=False,
2358-
mode=0
2362+
mode=0,
2363+
async_aware=False
23592364
)
23602365

23612366
def test_cli_empty_module_name(self):
@@ -2567,7 +2572,8 @@ def test_argument_parsing_basic(self):
25672572
show_summary=True,
25682573
output_format="pstats",
25692574
realtime_stats=False,
2570-
mode=0
2575+
mode=0,
2576+
async_aware=False
25712577
)
25722578

25732579
def test_sort_options(self):

0 commit comments

Comments
 (0)