From e7f46e1d8c677b72a34bc909fb780eb9339aff89 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 10 Apr 2019 04:33:44 +0000 Subject: [PATCH] hdl.ast: fix some type checks. --- nmigen/hdl/ast.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index b64f7bf..3a42220 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -246,7 +246,8 @@ class Const(Value): shape = shape, self.value < 0 self.nbits, self.signed = shape if not isinstance(self.nbits, int) or self.nbits < 0: - raise TypeError("Width must be a non-negative integer, not '{!r}'", self.nbits) + raise TypeError("Width must be a non-negative integer, not '{!r}'" + .format(self.nbits)) self.value = self.normalize(self.value, shape) def shape(self): @@ -272,7 +273,8 @@ class AnyValue(Value, DUID): shape = shape, False self.nbits, self.signed = shape if not isinstance(self.nbits, int) or self.nbits < 0: - raise TypeError("Width must be a non-negative integer, not '{!r}'", self.nbits) + raise TypeError("Width must be a non-negative integer, not '{!r}'" + .format(self.nbits)) def shape(self): return self.nbits, self.signed -- 2.30.2