Skip to content

Commit 26b7df2

Browse files
pythongh-141004: Document PyRun_InteractiveOneObject (pythonGH-141405)
1 parent dc09870 commit 26b7df2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

Doc/c-api/veryhigh.rst

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,12 @@ the same library that the Python runtime is using.
100100
Otherwise, Python may not handle script file with LF line ending correctly.
101101
102102
103-
.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
104-
105-
This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below,
106-
leaving *flags* set to ``NULL``.
107-
108-
109-
.. c:function:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
103+
.. c:function:: int PyRun_InteractiveOneObject(FILE *fp, PyObject *filename, PyCompilerFlags *flags)
110104
111105
Read and execute a single statement from a file associated with an
112106
interactive device according to the *flags* argument. The user will be
113-
prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the
114-
:term:`filesystem encoding and error handler`.
107+
prompted using ``sys.ps1`` and ``sys.ps2``. *filename* must be a Python
108+
:class:`str` object.
115109
116110
Returns ``0`` when the input was
117111
executed successfully, ``-1`` if there was an exception, or an error code
@@ -120,6 +114,19 @@ the same library that the Python runtime is using.
120114
:file:`Python.h`, so must be included specifically if needed.)
121115
122116
117+
.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
118+
119+
This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below,
120+
leaving *flags* set to ``NULL``.
121+
122+
123+
.. c:function:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
124+
125+
Similar to :c:func:`PyRun_InteractiveOneObject`, but *filename* is a
126+
:c:expr:`const char*`, which is decoded from the
127+
:term:`filesystem encoding and error handler`.
128+
129+
123130
.. c:function:: int PyRun_InteractiveLoop(FILE *fp, const char *filename)
124131
125132
This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` below,

0 commit comments

Comments
 (0)