.. _await-outside-async: await-outside-async / E1142 =========================== **Message emitted:** ``'await' should be used within an async function`` **Description:** *Emitted when await is used outside an async function.* **Problematic code:** .. literalinclude:: /data/messages/a/await-outside-async/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/a/await-outside-async/good.py :language: python **Related links:** - `PEP 492 `_ Created by the `typecheck `__ checker.