Skip to content

Commit

Permalink
Merge branch 'master' into issue-11965
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Aug 13, 2023
2 parents 23a6a0f + 9787a26 commit 3a7695e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280 # must match test-requirements.txt
rev: v0.0.281 # must match test-requirements.txt
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down
15 changes: 13 additions & 2 deletions docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,20 @@ example:
top = await f() # Error: "await" outside function [top-level-await]
.. _code-await-not-async:

Warn about await expressions used outside of coroutines [await-not-async]
-------------------------------------------------------------------------

``await`` must be used inside a coroutine.

.. code-block:: python
async def f() -> None:
...
def g() -> None:
# This is a blocker error and cannot be silenced.
await f() # Error: "await" outside coroutine ("async def")
await f() # Error: "await" outside coroutine ("async def") [await-not-async]
.. _code-assert-type:

Expand Down

0 comments on commit 3a7695e

Please sign in to comment.