From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 05:11:58 +0000 (+0000) Subject: use assert not if/print/exit X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b6a5b09939a58b76b7e7f52ceb7a73e35e6d46f;p=pinmux.git use assert not if/print/exit --- diff --git a/src/actual_pinmux.py b/src/actual_pinmux.py index bdfcc2e..e5aa499 100644 --- a/src/actual_pinmux.py +++ b/src/actual_pinmux.py @@ -70,13 +70,10 @@ def init(p): temp = cell[i + 1].translate(digits) temp = temp.replace(' ', '') x = dictionary.get(temp) - if x is None: - print( - "ERROR: The signal : " + - str(cell[i + 1]) + - " of pinmap.txt isn't present in the current dictionary.\ - \nUpdate dictionary or fix-typo.") - exit(1) + assert x is not None, "ERROR: The signal : " + \ + str(cell[i + 1]) + \ + " of pinmap.txt isn't present \nin the current" + \ + " dictionary. Update dictionary or fix-typo." if x == "input": p.pinmux += \ mux_wire.format(cell[0], i, "wr" + cell[i + 1]) + "\n"