Skip to content

Commit 6643505

Browse files
committed
fixup! gh-138709: Implement CPU time profiling in profiling.sample
1 parent 8791ec8 commit 6643505

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,12 +2531,7 @@ def main():
25312531
all_threads=True,
25322532
)
25332533
except (PermissionError, RuntimeError) as e:
2534-
if "Failed to find the PyRuntime section" in str(e):
2535-
self.skipTest("Failed to find PyRuntime section in subprocess")
2536-
elif "Insufficient permissions" in str(e):
2537-
self.skipTest("Insufficient permissions for remote profiling")
2538-
else:
2539-
raise
2534+
self.skipTest("Insufficient permissions for remote profiling")
25402535

25412536
cpu_mode_output = captured_output.getvalue()
25422537

@@ -2555,12 +2550,7 @@ def main():
25552550
all_threads=True,
25562551
)
25572552
except (PermissionError, RuntimeError) as e:
2558-
if "Failed to find the PyRuntime section" in str(e):
2559-
self.skipTest("Failed to find PyRuntime section in subprocess")
2560-
elif "Insufficient permissions" in str(e):
2561-
self.skipTest("Insufficient permissions for remote profiling")
2562-
else:
2563-
raise
2553+
self.skipTest("Insufficient permissions for remote profiling")
25642554

25652555
wall_mode_output = captured_output.getvalue()
25662556

Modules/_remote_debugging_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
#ifdef MS_WINDOWS
4545
#include <windows.h>
4646
#include <winternl.h>
47-
// Define the NTSTATUS values we need
47+
#include <ntifs.h>
48+
// ntstatus.h conflicts with windows.h so we have to define the NTSTATUS values we need
4849
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
4950
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
5051
typedef enum _WIN32_THREADSTATE {

0 commit comments

Comments
 (0)