Skip to content

Commit 0d0565c

Browse files
committed
[Fixed] Skip setting VARIANT* when we don't have variables
Might need more work
1 parent a78e16f commit 0d0565c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

kibot/out_base.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,14 +1169,20 @@ def run(self, output_dir):
11691169
self.load_list_components()
11701170
variant = self.variant or GS.solved_global_variant
11711171
if variant:
1172-
GS.pro_variables['VARIANT'] = variant.name
1173-
GS.pro_variables['VARIANT_DESC'] = variant.comment
1172+
if GS.pro_variables:
1173+
GS.pro_variables['VARIANT'] = variant.name
1174+
GS.pro_variables['VARIANT_DESC'] = variant.comment
1175+
else:
1176+
logger.debug("Not setting VARIANT*")
11741177
if GS.ki10 and variant.type == 'kicad' and GS.board:
11751178
logger.debug(f"Switching the PCB to {variant.name}")
11761179
GS.board.SetCurrentVariant(variant.name)
11771180
else:
11781181
# KiCad 10 behavior when "Default" variant is selected
1179-
GS.pro_variables['VARIANT'] = GS.pro_variables['VARIANT_DESC'] = ""
1182+
if GS.pro_variables:
1183+
GS.pro_variables['VARIANT'] = GS.pro_variables['VARIANT_DESC'] = ""
1184+
else:
1185+
logger.debug("Not setting VARIANT*")
11801186
if GS.ki10 and GS.board:
11811187
logger.debug("Switching the PCB to 'Default' variant")
11821188
GS.board.SetCurrentVariant('')

0 commit comments

Comments
 (0)