File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1027,9 +1027,20 @@ example:
1027
1027
1028
1028
top = await f() # Error: "await" outside function [top-level-await]
1029
1029
1030
+ .. _code-await-not-async :
1031
+
1032
+ Warn about await expressions used outside of coroutines [await-not-async]
1033
+ -------------------------------------------------------------------------
1034
+
1035
+ ``await `` must be used inside a coroutine.
1036
+
1037
+ .. code-block :: python
1038
+
1039
+ async def f () -> None :
1040
+ ...
1041
+
1030
1042
def g () -> None :
1031
- # This is a blocker error and cannot be silenced.
1032
- await f() # Error: "await" outside coroutine ("async def")
1043
+ await f() # Error: "await" outside coroutine ("async def") [await-not-async]
1033
1044
1034
1045
.. _code-assert-type :
1035
1046
You can’t perform that action at this time.
0 commit comments