From cd783583bb2fe70490972b4f67dfa61bb91ae350 Mon Sep 17 00:00:00 2001 From: Evan Hubinger Date: Wed, 24 May 2023 18:39:43 -0700 Subject: [PATCH] Fix py37 tests --- coconut/compiler/header.py | 2 ++ coconut/constants.py | 1 + 2 files changed, 3 insertions(+) diff --git a/coconut/compiler/header.py b/coconut/compiler/header.py index da436a7fa..1ba8b4188 100644 --- a/coconut/compiler/header.py +++ b/coconut/compiler/header.py @@ -579,6 +579,8 @@ def NamedTuple(name, fields): except ImportError: class YouNeedToInstallTypingExtensions{object}: __slots__ = () + def __init__(self): + raise _coconut.TypeError('Protocols cannot be instantiated') Protocol = YouNeedToInstallTypingExtensions typing.Protocol = Protocol '''.format(**format_dict), diff --git a/coconut/constants.py b/coconut/constants.py index f09255863..fc8815357 100644 --- a/coconut/constants.py +++ b/coconut/constants.py @@ -80,6 +80,7 @@ def get_bool_env_var(env_var, default=False): ((PY2 and not PY26) or PY35) and not (PYPY and WINDOWS) and (PY37 or not PYPY) + and sys.version_info[:2] != (3, 7) ) MYPY = ( PY37