Skip to content

Commit 80fab75

Browse files
committed
Use PyUnicode_FSDecoder instead of os.fsdecode
1 parent 35003a8 commit 80fab75

File tree

5 files changed

+4
-15
lines changed

5 files changed

+4
-15
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 0 additions & 1 deletion
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ struct _Py_global_strings {
458458
STRUCT_FOR_ID(fromlist)
459459
STRUCT_FOR_ID(fromtimestamp)
460460
STRUCT_FOR_ID(fromutc)
461-
STRUCT_FOR_ID(fsdecode)
462461
STRUCT_FOR_ID(fset)
463462
STRUCT_FOR_ID(func)
464463
STRUCT_FOR_ID(future)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 0 additions & 1 deletion
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: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/sysmodule.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,14 +2525,10 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
25252525
/*[clinic end generated code: output=7d94c56afe4a52c0 input=39908ca2c5fe1eb0]*/
25262526
{
25272527
PyObject *ret = NULL;
2528-
PyObject *os = PyImport_ImportModule("os");
2529-
if (os) {
2530-
PyObject *path = PyObject_CallMethodOneArg(os, &_Py_ID(fsdecode), script);
2531-
if (path) {
2532-
ret = sys_remote_exec_unicode_path(module, pid, path);
2533-
Py_DECREF(path);
2534-
}
2535-
Py_DECREF(os);
2528+
PyObject *path;
2529+
if (PyUnicode_FSDecoder(script, &path)) {
2530+
ret = sys_remote_exec_unicode_path(module, pid, path);
2531+
Py_DECREF(path);
25362532
}
25372533
return ret;
25382534
}

0 commit comments

Comments
 (0)