From 85df414f6d6762a3b64bac9172abeebeddbb1304 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 18 Aug 2023 08:45:26 +0100 Subject: [PATCH] Address type checker not dealing with try..except block --- setuptools_rust/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py index c99cfd10..70365b01 100644 --- a/setuptools_rust/build.py +++ b/setuptools_rust/build.py @@ -784,7 +784,7 @@ def _get_bdist_wheel_cmd( # type: ignore[no-any-unimported] ) -> Optional[CommandBdistWheel]: try: cmd_obj = dist.get_command_obj("bdist_wheel", create=create) - cmd_obj.ensure_finalized() - return cast(CommandBdistWheel, cmd_obj) # type: ignore [no-any-unimported] + cmd_obj.ensure_finalized() # type: ignore[union-attr] + return cast(CommandBdistWheel, cmd_obj) # type: ignore[no-any-unimported] except Exception: return None