From 50fa2516faeeb40a63e700ef4160a1d52ae036d9 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