From c69a1316ad438dcde49366cfe0efa5ed386f60a4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 12 Aug 2021 12:03:39 +0800 Subject: [PATCH] compiler: stop using sys.version_info for parser --- artiq/compiler/embedding.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/artiq/compiler/embedding.py b/artiq/compiler/embedding.py index 6fa6078f3..89866c7c8 100644 --- a/artiq/compiler/embedding.py +++ b/artiq/compiler/embedding.py @@ -5,7 +5,7 @@ the references to the host objects and translates the functions annotated as ``@kernel`` when they are referenced. """ -import sys, os, re, linecache, inspect, textwrap, types as pytypes, numpy +import os, re, linecache, inspect, textwrap, types as pytypes, numpy from collections import OrderedDict, defaultdict from pythonparser import ast, algorithm, source, diagnostic, parse_buffer @@ -967,13 +967,11 @@ class Stitcher: # Parse. source_buffer = source.Buffer(source_code, filename, first_line) - lexer = source_lexer.Lexer(source_buffer, version=sys.version_info[0:2], - diagnostic_engine=self.engine) + lexer = source_lexer.Lexer(source_buffer, version=(3, 6), diagnostic_engine=self.engine) lexer.indent = [(initial_indent, source.Range(source_buffer, 0, len(initial_whitespace)), initial_whitespace)] - parser = source_parser.Parser(lexer, version=sys.version_info[0:2], - diagnostic_engine=self.engine) + parser = source_parser.Parser(lexer, version=(3, 6), diagnostic_engine=self.engine) function_node = parser.file_input().body[0] # Mangle the name, since we put everything into a single module.