From 91f34a2815d960f97931efd5ecfaa72031e17ff9 Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Sat, 21 Sep 2024 17:46:02 -0400 Subject: [PATCH] Update NativeMixin impl to remove mypy error. --- dmoj/executors/asm_executor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dmoj/executors/asm_executor.py b/dmoj/executors/asm_executor.py index b11d9c6eb..698d602ee 100644 --- a/dmoj/executors/asm_executor.py +++ b/dmoj/executors/asm_executor.py @@ -239,7 +239,11 @@ class UnknownPlatformMixin(ASMExecutor): abi = PTBOX_ABI_INVALID -NativeMixin: Any = ( - [cls for cls in (PlatformX86Mixin, PlatformX64Mixin, PlatformARMMixin, PlatformARM64Mixin) if cls.abi == NATIVE_ABI] - or [UnknownPlatformMixin] -)[0] +NativeMixin: Any = next( + ( + cls + for cls in (PlatformX86Mixin, PlatformX64Mixin, PlatformARMMixin, PlatformARM64Mixin) + if cls.abi == NATIVE_ABI + ), + UnknownPlatformMixin, +)