From f9e0d7f4b0af79708ddf52ad1f03f813f7f0b710 Mon Sep 17 00:00:00 2001 From: weckyy702 Date: Mon, 4 Jan 2021 13:35:02 +0100 Subject: [PATCH] added version check to interpreter --- interpreter/interpret_source.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interpreter/interpret_source.py b/interpreter/interpret_source.py index 86b0690..0651685 100644 --- a/interpreter/interpret_source.py +++ b/interpreter/interpret_source.py @@ -1,13 +1,17 @@ import logging import re +import sys from typing import Dict, List, Match, Tuple, Union from errors.custom import InterpreterException, JavaSyntaxError, ScopeNotFoundException from draw.Iinstruction import * +if sys.version_info < (3, 9): + raise Exception("Unsupported Python version! Pyton 3.9 is required") + logging.warning("""Because the Interpreter is still WIP, some Java language features are not supported. These include: *else if statements - *for loops + *foreach loops (will throw JavaSyntaxError) *Constructors (will be ignored) Please remove these features from the source code as they will result in incorrect behaviour""")