From 98aa7e8444d57b750830a97fc9bddc907c117875 Mon Sep 17 00:00:00 2001 From: Tai An Date: Wed, 9 Sep 2026 03:16:59 -0700 Subject: [PATCH] [None][fix] drop the stale `from e` in the missing-wheel SetupError In setup.py's extract_from_precompiled, the "Failed to get wheel file" SetupError chains `from e`, but `e` is only bound by the `except Exception as e` of the download branch above. On the for/else path `e` is always unbound: a local precompiled file skips the download branch entirely, a successful download catches nothing, and a failed download already raised. Python 3 also deletes the `as` target at the end of the except block. A tar.gz without a TensorRT-LLM/tensorrt_llm-*.whl member therefore fails with `UnboundLocalError: cannot access local variable 'e'` instead of the intended SetupError naming the bad archive. Signed-off-by: Tai An --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7a3b7d2af8f7..3edc88e064f2 100644 --- a/setup.py +++ b/setup.py @@ -305,7 +305,7 @@ def extract_from_precompiled(precompiled_location: str, package_data: list[str], break else: raise SetupError( - f"Failed to get wheel file from {precompiled_path}.") from e + f"Failed to get wheel file from {precompiled_path}.") wheel_path = os.path.join(workspace, member.name) tar.extract(member, path=workspace, filter=tarfile.data_filter)