* :ref:`bridge <asyncio-futures>` callback-based libraries and code
with async/await syntax.
+.. include:: ../includes/wasm-notavail.rst
+
.. _asyncio-cli:
+.. rubric:: asyncio REPL
+
You can experiment with an ``asyncio`` concurrent context in the REPL:
.. code-block:: pycon
>>> await asyncio.sleep(10, result='hello')
'hello'
-.. include:: ../includes/wasm-notavail.rst
+.. audit-event:: cpython.run_stdin "" ""
+
+.. versionchanged:: 3.11.10 (also 3.10.15, 3.9.20, and 3.8.20)
+ Emits audit events.
.. We use the "rubric" directive here to avoid creating
the "Reference" subsection in the TOC.
This variable can also be modified by Python code using :data:`os.environ`
to force inspect mode on program termination.
+ .. audit-event:: cpython.run_stdin "" ""
+
+ .. versionchanged:: 3.11.10 (also 3.10.15, 3.9.20, and 3.8.20)
+ Emits audit events.
+
.. envvar:: PYTHONUNBUFFERED
if __name__ == '__main__':
+ sys.audit("cpython.run_stdin")
+
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
--- /dev/null
+Fixed missing audit events around interactive use of Python, now also
+properly firing for ``python -i``, as well as for ``python -m asyncio``. The
+event in question is ``cpython.run_stdin``.
return;
}
+ if (PySys_Audit("cpython.run_stdin", NULL) < 0) {
+ return;
+ }
+
PyCompilerFlags cf = _PyCompilerFlags_INIT;
int res = PyRun_AnyFileFlags(stdin, "<stdin>", &cf);
*exitcode = (res != 0);