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

Appearance settings

Commit f8be85f

Browse filesBrowse files
Use "goto error:.
1 parent bd30460 commit f8be85f
Copy full SHA for f8be85f

File tree

Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed

‎Python/sysmodule.c

Copy file name to clipboardExpand all lines: Python/sysmodule.c
+9-10Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,15 +2491,13 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
24912491
#ifdef MS_WINDOWS
24922492
PyObject *unicode_path;
24932493
if (PyUnicode_FSDecoder(path, &unicode_path) < 0) {
2494-
Py_DECREF(path);
2495-
return NULL;
2494+
goto error;
24962495
}
24972496
// Use UTF-16 (wide char) version of the path for permission checks
24982497
wchar_t *debugger_script_path_w = PyUnicode_AsWideCharString(unicode_path, NULL);
24992498
Py_DECREF(unicode_path);
25002499
if (debugger_script_path_w == NULL) {
2501-
Py_DECREF(path);
2502-
return NULL;
2500+
goto error;
25032501
}
25042502
DWORD attr = GetFileAttributesW(debugger_script_path_w);
25052503
if (attr == INVALID_FILE_ATTRIBUTES) {
@@ -2514,8 +2512,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
25142512
else {
25152513
PyErr_SetFromWindowsErr(err);
25162514
}
2517-
Py_DECREF(path);
2518-
return NULL;
2515+
goto error;
25192516
}
25202517
PyMem_Free(debugger_script_path_w);
25212518
#else // MS_WINDOWS
@@ -2530,17 +2527,19 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
25302527
default:
25312528
PyErr_SetFromErrno(PyExc_OSError);
25322529
}
2533-
Py_DECREF(path);
2534-
return NULL;
2530+
goto error;
25352531
}
25362532
#endif // MS_WINDOWS
25372533
if (_PySysRemoteDebug_SendExec(pid, 0, debugger_script_path) < 0) {
2538-
Py_DECREF(path);
2539-
return NULL;
2534+
goto error;
25402535
}
25412536

25422537
Py_DECREF(path);
25432538
Py_RETURN_NONE;
2539+
2540+
error:
2541+
Py_DECREF(path);
2542+
return NULL;
25442543
}
25452544

25462545

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.