From: whitequark Date: Wed, 10 Apr 2019 04:33:44 +0000 (+0000) Subject: hdl.ast: fix some type checks. X-Git-Tag: working~16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50fa2516faeeb40a63e700ef4160a1d52ae036d9;p=nmigen.git hdl.ast: fix some type checks. --- 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