From 454c3d806c52d811e824153ffe5420f4402d65a8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 28 Jul 2020 10:46:29 +0800 Subject: [PATCH] hack-patch pythonparser for python 3.8 --- artiq-fast/pkgs/python-deps.nix | 2 +- .../{python37hack.patch => pythonparserver.patch} | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) rename artiq-fast/pkgs/{python37hack.patch => pythonparserver.patch} (83%) diff --git a/artiq-fast/pkgs/python-deps.nix b/artiq-fast/pkgs/python-deps.nix index 2b3b3c7..ad76745 100644 --- a/artiq-fast/pkgs/python-deps.nix +++ b/artiq-fast/pkgs/python-deps.nix @@ -35,7 +35,7 @@ rec { rev = "5b391fe86f43bb9f4f96c5bc0532e2a112db2936"; sha256 = "1gw1fk4y2l6bwq0fg2a9dfc1rvq8cv492dyil96amjdhsxvnx35b"; }; - patches = [ ./python37hack.patch ]; + patches = [ ./pythonparserver.patch ]; propagatedBuildInputs = with python3Packages; [ regex ]; }; diff --git a/artiq-fast/pkgs/python37hack.patch b/artiq-fast/pkgs/pythonparserver.patch similarity index 83% rename from artiq-fast/pkgs/python37hack.patch rename to artiq-fast/pkgs/pythonparserver.patch index 391da2f..109d0c3 100644 --- a/artiq-fast/pkgs/python37hack.patch +++ b/artiq-fast/pkgs/pythonparserver.patch @@ -1,25 +1,27 @@ diff --git a/pythonparser/lexer.py b/pythonparser/lexer.py -index a62eaf1..2c48d36 100644 +index a62eaf1..c70e85a 100644 --- a/pythonparser/lexer.py +++ b/pythonparser/lexer.py -@@ -79,6 +79,7 @@ class Lexer: +@@ -79,6 +79,8 @@ class Lexer: (3, 4): _reserved_3_1, (3, 5): _reserved_3_5, (3, 6): _reserved_3_5, + (3, 7): _reserved_3_5, ++ (3, 8): _reserved_3_5, } """ A map from a tuple (*major*, *minor*) corresponding to Python version to -@@ -102,6 +103,7 @@ class Lexer: +@@ -102,6 +104,8 @@ class Lexer: (3, 4): _string_prefixes_3_3, (3, 5): _string_prefixes_3_3, (3, 6): _string_prefixes_3_6, + (3, 7): _string_prefixes_3_6, ++ (3, 8): _string_prefixes_3_6, } """ A map from a tuple (*major*, *minor*) corresponding to Python version to diff --git a/pythonparser/parser.py b/pythonparser/parser.py -index 10c741d..f748695 100644 +index 10c741d..62b93e1 100644 --- a/pythonparser/parser.py +++ b/pythonparser/parser.py @@ -419,7 +419,7 @@ class Parser(object): @@ -27,7 +29,7 @@ index 10c741d..f748695 100644 self.yield_expr = self.yield_expr__26 return - elif version in ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)): -+ elif version in ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (3, 7)): ++ elif version in ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8)): if version == (3, 0): self.with_stmt = self.with_stmt__26 # lol else: