mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)
This accomplishes 2 things: * consolidates some common code between getpath.c and getpathp.c * makes the helpers available to code in other files FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx(). Note that this change is mostly moving code around. No behavior is meant to change. https://bugs.python.org/issue45211
This commit is contained in:
parent
e5f13ce5b4
commit
ae7839bbe8
8 changed files with 164 additions and 100 deletions
|
|
@ -30,6 +30,17 @@ _Py_IsMainInterpreter(PyInterpreterState *interp)
|
|||
}
|
||||
|
||||
|
||||
static inline const PyConfig *
|
||||
_Py_GetMainConfig(void)
|
||||
{
|
||||
PyInterpreterState *interp = _PyRuntime.interpreters.main;
|
||||
if (interp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return _PyInterpreterState_GetConfig(interp);
|
||||
}
|
||||
|
||||
|
||||
/* Only handle signals on the main thread of the main interpreter. */
|
||||
static inline int
|
||||
_Py_ThreadCanHandleSignals(PyInterpreterState *interp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue