From b20efb9a637072533add0fd12409a67eda8e8ef5 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Thu, 4 Jul 2024 17:53:17 +0000 Subject: [PATCH] Fix syntax error with mpy-cross-8.x --- kmk/keys.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kmk/keys.py b/kmk/keys.py index c2eaaefdd..3a4af6623 100644 --- a/kmk/keys.py +++ b/kmk/keys.py @@ -568,7 +568,12 @@ def make_argumented_key( ) -> Key: def argumented_key(*args, **kwargs) -> Key: - return constructor(*args, **(_kwargs | kwargs)) + # This is a very ugly workaround for missing syntax in mpy-cross 8.x + # and, once EOL, can be replaced by: + # return constructor(*args, **_kwargs, **kwargs) + k = _kwargs.copy() + k.update(**kwargs) + return constructor(*args, **k) for name in names: KC[name] = argumented_key