Skip to content

Commit 4dc3c8f

Browse files
bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)
(cherry picked from commit d08972f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent b262659 commit 4dc3c8f

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Doc/reference/expressions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Common syntax elements for comprehensions are:
172172

173173
.. productionlist::
174174
comprehension: `expression` `comp_for`
175-
comp_for: [ASYNC] "for" `target_list` "in" `or_test` [`comp_iter`]
175+
comp_for: ["async"] "for" `target_list` "in" `or_test` [`comp_iter`]
176176
comp_iter: `comp_for` | `comp_if`
177177
comp_if: "if" `expression_nocond` [`comp_iter`]
178178

Lib/token.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@
6565
ELLIPSIS = 52
6666
# Don't forget to update the table _PyParser_TokenNames in tokenizer.c!
6767
OP = 53
68-
AWAIT = 54
69-
ASYNC = 55
70-
ERRORTOKEN = 56
68+
ERRORTOKEN = 54
7169
# These aren't used by the C tokenizer but are needed for tokenize.py
72-
COMMENT = 57
73-
NL = 58
74-
ENCODING = 59
75-
N_TOKENS = 60
70+
COMMENT = 55
71+
NL = 56
72+
ENCODING = 57
73+
N_TOKENS = 58
7674
# Special definitions for cooperation with parser
7775
NT_OFFSET = 256
7876
#--end constants--

Lib/tokenize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def compat(self, token, iterable):
284284
self.encoding = tokval
285285
continue
286286

287-
if toknum in (NAME, NUMBER, ASYNC, AWAIT):
287+
if toknum in (NAME, NUMBER):
288288
tokval += ' '
289289

290290
# Insert a space between two consecutive strings

0 commit comments

Comments
 (0)