mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.14] gh-132775: Add _PyCode_GetScriptXIData() (gh-133676)
This converts functions, code, str, bytes, bytearray, and memoryview objects to PyCodeObject,
and ensure that the object looks like a script. That means no args, no return, and no closure.
_PyCode_GetPureScriptXIData() takes it a step further and ensures there are no globals.
We also add _PyObject_SupportedAsScript() to the internal C-API.
(cherry picked from commit c81fa2b9cd
, AKA gh-133480)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
parent
dc1a4dda88
commit
1059548686
8 changed files with 366 additions and 0 deletions
|
@ -25,6 +25,7 @@ extern int _PyRun_InteractiveLoopObject(
|
|||
PyObject *filename,
|
||||
PyCompilerFlags *flags);
|
||||
|
||||
extern int _PyObject_SupportedAsScript(PyObject *);
|
||||
extern const char* _Py_SourceAsString(
|
||||
PyObject *cmd,
|
||||
const char *funcname,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue