Skip to content

Commit

Permalink
Fix syntax error with mpy-cross-8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
xs5871 committed Jul 5, 2024
1 parent a1c0b65 commit b20efb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kmk/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b20efb9

Please sign in to comment.