Skip to content

Commit ffd340f

Browse files
committed
Address code review
1 parent 90ab65f commit ffd340f

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ struct _Py_global_strings {
458458
STRUCT_FOR_ID(fromlist)
459459
STRUCT_FOR_ID(fromtimestamp)
460460
STRUCT_FOR_ID(fromutc)
461+
STRUCT_FOR_ID(fsdecode)
461462
STRUCT_FOR_ID(fset)
462463
STRUCT_FOR_ID(func)
463464
STRUCT_FOR_ID(future)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/ceval_gil.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,8 @@ static inline void run_remote_debugger_script(const char *path)
12141214
int fd = PyObject_AsFileDescriptor(fileobj);
12151215
if (fd == -1) {
12161216
PyErr_FormatUnraisable("Can't find fd for debugger script %s", path);
1217-
} else {
1217+
}
1218+
else {
12181219
int dup_fd = -1;
12191220
FILE *f = NULL;
12201221

@@ -1237,7 +1238,8 @@ static inline void run_remote_debugger_script(const char *path)
12371238
#endif
12381239
if (!f) {
12391240
PyErr_SetFromErrno(PyExc_OSError);
1240-
} else {
1241+
}
1242+
else {
12411243
PyRun_AnyFileEx(f, path, 1);
12421244
}
12431245

@@ -1246,7 +1248,7 @@ static inline void run_remote_debugger_script(const char *path)
12461248
}
12471249
}
12481250

1249-
PyObject* res = PyObject_CallMethod(fileobj, "close", "");
1251+
PyObject* res = PyObject_CallMethodNoArgs(fileobj, &_Py_ID(close));
12501252
if (!res) {
12511253
PyErr_FormatUnraisable("Error closing debugger script %s", path);
12521254
} else {

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
25272527
PyObject *ret = NULL;
25282528
PyObject *os = PyImport_ImportModule("os");
25292529
if (os) {
2530-
PyObject *path = PyObject_CallMethod(os, "fsdecode", "O", script);
2530+
PyObject *path = PyObject_CallMethodOneArg(os, &_Py_ID(fsdecode), script);
25312531
if (path) {
25322532
ret = sys_remote_exec_unicode_path(module, pid, path);
25332533
Py_DECREF(path);

0 commit comments

Comments
 (0)