From 1b6a5b09939a58b76b7e7f52ceb7a73e35e6d46f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 05:11:58 +0000 Subject: [PATCH] use assert not if/print/exit --- src/actual_pinmux.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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" -- 2.30.2