From 96efd71e1cad2e015cc5934b121a2c821841584c Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 15 Oct 2020 08:54:48 +0000 Subject: [PATCH] build.plat: avoid type confusion in _check_feature. Before this commit, `_check_feature(valid_xdrs=0)` would mean that XDR buffers are not supported. Only `_check_feature(valid_xdrs=())` was intended to be an indicator of that. --- nmigen/build/plat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmigen/build/plat.py b/nmigen/build/plat.py index 6384249..31c9704 100644 --- a/nmigen/build/plat.py +++ b/nmigen/build/plat.py @@ -177,7 +177,7 @@ class Platform(ResourceManager, metaclass=ABCMeta): .format(type(self).__name__)) def _check_feature(self, feature, pin, attrs, valid_xdrs, valid_attrs): - if not valid_xdrs: + if len(valid_xdrs) == 0: raise NotImplementedError("Platform '{}' does not support {}" .format(type(self).__name__, feature)) elif pin.xdr not in valid_xdrs: -- 2.30.2