Skip to content

Commit 9f51d1c

Browse files
committed
refactor: reorganize imports and improve error message handling in remote pdb tests
Signed-off-by: Frost Ming <[email protected]>
1 parent 045c824 commit 9f51d1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/test/test_remote_pdb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,11 +1594,11 @@ def test_attach_to_non_existent_process(self):
15941594
with force_color(False):
15951595
result = subprocess.run([sys.executable, "-m", "pdb", "-p", "999999"], text=True, capture_output=True)
15961596
self.assertNotEqual(result.returncode, 0)
1597-
error = (
1598-
"The specified process cannot be attached to due to insufficient permissions."
1599-
if sys.platform == "darwin" else
1600-
"Cannot attach to pid 999999, please make sure that the process exists"
1601-
)
1597+
if sys.platform == "darwin":
1598+
# On MacOS, attaching to a non-existent process gives PermissionError
1599+
error = "The specified process cannot be attached to due to insufficient permissions"
1600+
else:
1601+
error = "Cannot attach to pid 999999, please make sure that the process exists"
16021602
self.assertIn(error, result.stdout)
16031603

16041604

0 commit comments

Comments
 (0)