summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/clinic/sysmodule.c.h20
-rw-r--r--Python/pythonrun.c2
-rw-r--r--Python/stdlib_module_names.h1
-rw-r--r--Python/sysmodule.c16
4 files changed, 36 insertions, 3 deletions
diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h
index 0a8704c..56a831e 100644
--- a/Python/clinic/sysmodule.c.h
+++ b/Python/clinic/sysmodule.c.h
@@ -1485,6 +1485,24 @@ exit:
return return_value;
}
+PyDoc_STRVAR(sys__baserepl__doc__,
+"_baserepl($module, /)\n"
+"--\n"
+"\n"
+"Private function for getting the base REPL");
+
+#define SYS__BASEREPL_METHODDEF \
+ {"_baserepl", (PyCFunction)sys__baserepl, METH_NOARGS, sys__baserepl__doc__},
+
+static PyObject *
+sys__baserepl_impl(PyObject *module);
+
+static PyObject *
+sys__baserepl(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return sys__baserepl_impl(module);
+}
+
PyDoc_STRVAR(sys__is_gil_enabled__doc__,
"_is_gil_enabled($module, /)\n"
"--\n"
@@ -1556,4 +1574,4 @@ exit:
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=352ac7a0085e8a1f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ef7c35945443d300 input=a9049054013a1b77]*/
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 31213ae..ce7f194 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -83,8 +83,6 @@ _PyRun_AnyFileObject(FILE *fp, PyObject *filename, int closeit,
return res;
}
-
-/* Parse input from a file and execute it */
int
PyRun_AnyFileExFlags(FILE *fp, const char *filename, int closeit,
PyCompilerFlags *flags)
diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h
index ba32084..9686d10 100644
--- a/Python/stdlib_module_names.h
+++ b/Python/stdlib_module_names.h
@@ -65,6 +65,7 @@ static const char* _Py_stdlib_module_names[] = {
"_pydecimal",
"_pyio",
"_pylong",
+"_pyrepl",
"_queue",
"_random",
"_scproxy",
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 17c4a5f..69bee32 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2396,6 +2396,21 @@ sys__get_cpu_count_config_impl(PyObject *module)
}
/*[clinic input]
+sys._baserepl
+
+Private function for getting the base REPL
+[clinic start generated code]*/
+
+static PyObject *
+sys__baserepl_impl(PyObject *module)
+/*[clinic end generated code: output=f19a36375ebe0a45 input=ade0ebb9fab56f3c]*/
+{
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ PyRun_AnyFileExFlags(stdin, "<stdin>", 0, &cf);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
sys._is_gil_enabled -> bool
Return True if the GIL is currently enabled and False otherwise.
@@ -2579,6 +2594,7 @@ static PyMethodDef sys_methods[] = {
SYS_UNRAISABLEHOOK_METHODDEF
SYS_GET_INT_MAX_STR_DIGITS_METHODDEF
SYS_SET_INT_MAX_STR_DIGITS_METHODDEF
+ SYS__BASEREPL_METHODDEF
#ifdef Py_STATS
SYS__STATS_ON_METHODDEF
SYS__STATS_OFF_METHODDEF