Skip to content

Commit

Permalink
Do not fail if there are no custom DRC rules
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqwsx committed Feb 24, 2025
1 parent 995fe49 commit 5c25a71
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kikit/panelize.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,13 @@ def _inheriCustomDrcRules(self, board, netRenamer):
- if the rule contains condition, we identify boolean operations equals
and not equals for net names and net classes and rename the nets
"""
proFilename = os.path.splitext(board.GetFileName())[0]+'.kicad_dru'
druFilename = os.path.splitext(board.GetFileName())[0]+'.kicad_dru'
try:
with open(proFilename, encoding="utf-8") as f:
if os.stat(druFilename).st_size == 0:
# If the source board doesn't contain DRU files, there's nothing to
# inherit.
return
with open(druFilename, encoding="utf-8") as f:
rules = parseSexprListF(f)
except FileNotFoundError:
# If the source board doesn't contain DRU files, there's nothing to
Expand Down

0 comments on commit 5c25a71

Please sign in to comment.