Skip to content

Commit 7b72311

Browse files
committed
fixup! gh-138709: Implement CPU time profiling in profiling.sample
1 parent 997cdaf commit 7b72311

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
@@ -2427,12 +2427,7 @@ def main():
24272427
all_threads=True,
24282428
)
24292429
except (PermissionError, RuntimeError) as e:
2430-
if "Failed to find the PyRuntime section" in str(e):
2431-
self.skipTest("Failed to find PyRuntime section in subprocess")
2432-
elif "Insufficient permissions" in str(e):
2433-
self.skipTest("Insufficient permissions for remote profiling")
2434-
else:
2435-
raise
2430+
self.skipTest("Insufficient permissions for remote profiling")
24362431

24372432
cpu_mode_output = captured_output.getvalue()
24382433

@@ -2451,12 +2446,7 @@ def main():
24512446
all_threads=True,
24522447
)
24532448
except (PermissionError, RuntimeError) as e:
2454-
if "Failed to find the PyRuntime section" in str(e):
2455-
self.skipTest("Failed to find PyRuntime section in subprocess")
2456-
elif "Insufficient permissions" in str(e):
2457-
self.skipTest("Insufficient permissions for remote profiling")
2458-
else:
2459-
raise
2449+
self.skipTest("Insufficient permissions for remote profiling")
24602450

24612451
wall_mode_output = captured_output.getvalue()
24622452

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)