diff --git a/python/python-psi-impl/src/com/jetbrains/python/validation/AssignTargetAnnotator.java b/python/python-psi-impl/src/com/jetbrains/python/validation/AssignTargetAnnotator.java
index 1fcde48c7567..33ddcaac53c6 100644
--- a/python/python-psi-impl/src/com/jetbrains/python/validation/AssignTargetAnnotator.java
+++ b/python/python-psi-impl/src/com/jetbrains/python/validation/AssignTargetAnnotator.java
@@ -299,7 +299,7 @@ public class AssignTargetAnnotator extends PyAnnotator {
@Override
public void visitPyPrefixExpression(@NotNull PyPrefixExpression node) {
- if (node.getOperator() == PyTokenTypes.AWAIT_KEYWORD && node.getOperand() != null) {
+ if (node.getOperator() == PyTokenTypes.AWAIT_KEYWORD) {
getHolder().newAnnotation(HighlightSeverity.ERROR, message("ANN.cant.assign.to.await.expr")).range(node).create();
}
}
diff --git a/python/testData/highlighting/asyncAndAwaitAsIdentifiersIn37.py b/python/testData/highlighting/asyncAndAwaitAsIdentifiersIn37.py
index 6eceb6b295ff..b214b7c4381e 100644
--- a/python/testData/highlighting/asyncAndAwaitAsIdentifiersIn37.py
+++ b/python/testData/highlighting/asyncAndAwaitAsIdentifiersIn37.py
@@ -17,4 +17,4 @@ def await():
pass
-await = 10
\ No newline at end of file
+await = 10
\ No newline at end of file
diff --git a/python/testData/highlighting/awaitInDictPy36.py b/python/testData/highlighting/awaitInDictPy36.py
index c26ac3d90f07..fa1aaa5b9fd5 100644
--- a/python/testData/highlighting/awaitInDictPy36.py
+++ b/python/testData/highlighting/awaitInDictPy36.py
@@ -1,5 +1,5 @@
async def f11(x):
- y = {await: 10 for await in []} # fail
+ y = {await: 10 for await in []} # fail
await x
@@ -9,7 +9,7 @@ def f12(x):
async def f21(x):
- y = {mapper(await): 10 for await in []} # fail
+ y = {mapper(await): 10 for await in []} # fail
await x
@@ -19,7 +19,7 @@ def f22(x):
async def f31(x):
- await = [] # fail
+ await = [] # fail
y = {i: 10 for i in await} # fail
await x
@@ -51,7 +51,7 @@ async def f44(x):
async def f51():
- await = 5 # fail
+ await = 5 # fail
return {await: 10} # fail
@@ -61,7 +61,7 @@ def f52():
async def f61():
- await = 5 # fail
+ await = 5 # fail
return {"a": 10, await: 10, "b": 10} # fail
diff --git a/python/testData/highlighting/awaitInGenerator.py b/python/testData/highlighting/awaitInGenerator.py
index b9a044730548..af0538f6f3b7 100644
--- a/python/testData/highlighting/awaitInGenerator.py
+++ b/python/testData/highlighting/awaitInGenerator.py
@@ -1,5 +1,5 @@
async def f11(x):
- y = (await for await in []) # fail
+ y = (await for await in []) # fail
await x
@@ -9,7 +9,7 @@ def f12(x):
async def f21(x):
- y = (mapper(await) for await in []) # fail
+ y = (mapper(await) for await in []) # fail
await x
@@ -19,7 +19,7 @@ def f22(x):
async def f31(x):
- await = [] # fail
+ await = [] # fail
y = (i for i in await) # fail
await x
diff --git a/python/testData/highlighting/awaitInListPy36.py b/python/testData/highlighting/awaitInListPy36.py
index 56cd6293a2e0..12f906f4622b 100644
--- a/python/testData/highlighting/awaitInListPy36.py
+++ b/python/testData/highlighting/awaitInListPy36.py
@@ -1,5 +1,5 @@
async def f11(x):
- y = [await for await in []] # fail
+ y = [await for await in []] # fail
await x
@@ -9,7 +9,7 @@ def f12(x):
async def f21(x):
- y = [mapper(await) for await in []] # fail
+ y = [mapper(await) for await in []] # fail
await x
@@ -19,7 +19,7 @@ def f22(x):
async def f31(x):
- await = [] # fail
+ await = [] # fail
y = [i for i in await] # fail
await x
@@ -51,7 +51,7 @@ async def f44(x):
async def f51():
- await = 5 # fail
+ await = 5 # fail
return [await] # fail
@@ -61,7 +61,7 @@ def f52():
async def f61():
- await = 5 # fail
+ await = 5 # fail
return ["a", await, "b"] # fail
diff --git a/python/testData/highlighting/awaitInSetPy36.py b/python/testData/highlighting/awaitInSetPy36.py
index a19fdf082af7..b907389dec7d 100644
--- a/python/testData/highlighting/awaitInSetPy36.py
+++ b/python/testData/highlighting/awaitInSetPy36.py
@@ -1,5 +1,5 @@
async def f11(x):
- y = {await for await in []} # fail
+ y = {await for await in []} # fail
await x
@@ -9,7 +9,7 @@ def f12(x):
async def f21(x):
- y = {mapper(await) for await in []} # fail
+ y = {mapper(await) for await in []} # fail
await x
@@ -19,7 +19,7 @@ def f22(x):
async def f31(x):
- await = [] # fail
+ await = [] # fail
y = {i for i in await} # fail
await x
@@ -51,7 +51,7 @@ async def f44(x):
async def f51():
- await = 5 # fail
+ await = 5 # fail
return {await} # fail
@@ -61,7 +61,7 @@ def f52():
async def f61():
- await = 5 # fail
+ await = 5 # fail
return {"a", await, "b"} # fail
diff --git a/python/testData/highlighting/awaitInTuple.py b/python/testData/highlighting/awaitInTuple.py
index 006c6797d07f..dc2f352e1f73 100644
--- a/python/testData/highlighting/awaitInTuple.py
+++ b/python/testData/highlighting/awaitInTuple.py
@@ -1,5 +1,5 @@
async def f51():
- await = 5 # fail
+ await = 5 # fail
return (await) # fail
@@ -9,7 +9,7 @@ def f52():
async def f61():
- await = 5 # fail
+ await = 5 # fail
return ("a", await, "b") # fail