Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit009e7b3

Browse files
authored
gh-134064: Fix sys.remote_exec() error checking (#134067)
1 parentfc7f4c3 commit009e7b3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎Lib/test/test_sys.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,13 @@ def test_remote_exec_invalid_pid(self):
21762176
withself.assertRaises(OSError):
21772177
sys.remote_exec(99999,"print('should not run')")
21782178

2179+
deftest_remote_exec_invalid_script(self):
2180+
"""Test remote exec with invalid script type"""
2181+
withself.assertRaises(TypeError):
2182+
sys.remote_exec(0,None)
2183+
withself.assertRaises(TypeError):
2184+
sys.remote_exec(0,123)
2185+
21792186
deftest_remote_exec_syntax_error(self):
21802187
"""Test remote exec with syntax error in script"""
21812188
script='''

‎Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
24852485
PyObject*path;
24862486
constchar*debugger_script_path;
24872487

2488-
if (PyUnicode_FSConverter(script,&path)<0) {
2488+
if (PyUnicode_FSConverter(script,&path)==0) {
24892489
returnNULL;
24902490
}
24912491
debugger_script_path=PyBytes_AS_STRING(path);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp