use assert not raise ValueError
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 7 Feb 2020 14:18:21 +0000 (14:18 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 7 Feb 2020 14:18:21 +0000 (14:18 +0000)
src/ieee754/part_cmp/eq_gt_ge.py

index c6f15b3635ae616a6f8c2907a698d49958d662fb..70a202c327911cda1d802ce643858ed7c2847a97 100644 (file)
@@ -44,8 +44,8 @@ class PartitionedEqGtGe(Elaboratable):
         self.partition_points = PartitionPoints(partition_points)
         self.mwidth = len(self.partition_points)+1
         self.output = Signal(self.mwidth, reset_less=True)
-        if not self.partition_points.fits_in_width(width):
-            raise ValueError("partition_points doesn't fit in width")
+        assert self.partition_points.fits_in_width(width),
+                "partition_points doesn't fit in width"
 
     def elaborate(self, platform):
         m = Module()