From 66d6fae2bda9f9cd365a45496af5c569bedbee2e Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 15 Feb 2026 01:15:07 -0800 Subject: [PATCH] [AutoTool] Fix error handling for ccw=None --- masque/builder/tools.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/masque/builder/tools.py b/masque/builder/tools.py index 6bd7547..4162be3 100644 --- a/masque/builder/tools.py +++ b/masque/builder/tools.py @@ -590,6 +590,13 @@ class AutoTool(Tool, metaclass=ABCMeta): ) -> tuple[Port, LData]: success = False + + # Initialize these to avoid UnboundLocalError in the error message + bend_dxy, bend_angle = numpy.zeros(2), pi + itrans_dxy = numpy.zeros(2) + otrans_dxy = numpy.zeros(2) + btrans_dxy = numpy.zeros(2) + for straight in self.straights: for bend in self.bends: bend_dxy, bend_angle = self._bend2dxy(bend, ccw)