summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-29 02:18:52 (GMT)
committerGitHub <noreply@github.com>2023-08-29 02:18:52 (GMT)
commit15c5a50797020944e9ccb72bf3e28c3cca2e35c3 (patch)
tree19d539d1c82456c79cb8a7d4f45bd117a60fdead /Include/internal
parent301eb7e607be6ea15c7a1e792f1cb927ba423932 (diff)
downloadcpython-15c5a50797020944e9ccb72bf3e28c3cca2e35c3.zip
cpython-15c5a50797020944e9ccb72bf3e28c3cca2e35c3.tar.gz
cpython-15c5a50797020944e9ccb72bf3e28c3cca2e35c3.tar.bz2
gh-106320: Remove private pythonrun API (#108599)
Remove these private functions from the public C API: * _PyRun_AnyFileObject() * _PyRun_InteractiveLoopObject() * _PyRun_SimpleFileObject() * _Py_SourceAsString() Move them to the internal C API: add a new pycore_pythonrun.h header file. No longer export these functions.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_pythonrun.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/Include/internal/pycore_pythonrun.h b/Include/internal/pycore_pythonrun.h
new file mode 100644
index 0000000..0bfc570
--- /dev/null
+++ b/Include/internal/pycore_pythonrun.h
@@ -0,0 +1,39 @@
+#ifndef Py_INTERNAL_PYTHONRUN_H
+#define Py_INTERNAL_PYTHONRUN_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
+extern int _PyRun_SimpleFileObject(
+ FILE *fp,
+ PyObject *filename,
+ int closeit,
+ PyCompilerFlags *flags);
+
+extern int _PyRun_AnyFileObject(
+ FILE *fp,
+ PyObject *filename,
+ int closeit,
+ PyCompilerFlags *flags);
+
+extern int _PyRun_InteractiveLoopObject(
+ FILE *fp,
+ PyObject *filename,
+ PyCompilerFlags *flags);
+
+extern const char* _Py_SourceAsString(
+ PyObject *cmd,
+ const char *funcname,
+ const char *what,
+ PyCompilerFlags *cf,
+ PyObject **cmd_copy);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // !Py_INTERNAL_PYTHONRUN_H
+