From 27c46d62fe5181e3bfb341b1a8df92384fc6c5d3 Mon Sep 17 00:00:00 2001 From: Daniel Weidmann Date: Tue, 24 Feb 2026 20:09:35 +0100 Subject: [PATCH] Fix typechecking problems by using explicit variables --- src/build123d/build_common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/build123d/build_common.py b/src/build123d/build_common.py index 4fcc305..19fce10 100644 --- a/src/build123d/build_common.py +++ b/src/build123d/build_common.py @@ -263,9 +263,11 @@ class Builder(ABC, Generic[ShapeT]): # by CPython in Linux, Window & MacOS but may not be supported in other python # implementations. Support outside of these OS's is outside the scope of this # project. + builder_context = Builder._get_context() + current_frame = inspect.currentframe() same_scope = ( - Builder._get_context()._python_frame == inspect.currentframe().f_back - if Builder._get_context() + builder_context._python_frame == inspect.currentframe().f_back + if builder_context and current_frame else False )