From: whitequark Date: Thu, 15 Oct 2020 08:54:48 +0000 (+0000) Subject: build.plat: avoid type confusion in _check_feature. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96efd71e1cad2e015cc5934b121a2c821841584c;p=nmigen.git 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. --- 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: