File: Fix-python-grammar-to-compile-under-python-3.13.patch

package info (click to toggle)
python-pegen 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,980 kB
  • sloc: python: 15,064; makefile: 89
file content (24 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Subject: Fix Python grammar to compile under Python 3.13
Author: Daniel Fremont <dfremont@ucsc.edu>
Forwarded: not-needed

This patch was applied upstream to fix the compatibility with Python
3.13.

---
 data/python.gram | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: python-pegen/data/python.gram
===================================================================
--- python-pegen.orig/data/python.gram
+++ python-pegen/data/python.gram
@@ -2354,7 +2354,7 @@ invalid_while_stmt[NoReturn]:
         )
      }
 invalid_for_stmt[NoReturn]:
-    | [ASYNC] 'for' star_targets 'in' star_expressions NEWLINE { self.raise_syntax_error("expected ':'") }
+    | ['async'] 'for' star_targets 'in' star_expressions NEWLINE { self.raise_syntax_error("expected ':'") }
     | ['async'] a='for' star_targets 'in' star_expressions ':' NEWLINE !INDENT {
         self.raise_indentation_error(
             f"expected an indented block after 'for' statement on line {a.start[0]}"