lib.io: allow 0-width Pin

The main purpose of this change is migrating glasgow from the compat
`TSTriple` (which allows 0 width) to `Pin`.  This sort of change would
normally require a RFC, but `Pin` is already slated for
removal/replacement, so that was deemed to be unnecessary.
This commit is contained in:
Marcelina Kościelnicka 2023-07-03 23:26:28 +02:00 committed by Catherine
parent f4b013ac73
commit e6d8d5a354

View file

@ -12,8 +12,8 @@ def pin_layout(width, dir, xdr=0):
See :class:`Pin` for details.
"""
if not isinstance(width, int) or width < 1:
raise TypeError("Width must be a positive integer, not {!r}"
if not isinstance(width, int) or width < 0:
raise TypeError("Width must be a non-negative integer, not {!r}"
.format(width))
if dir not in ("i", "o", "oe", "io"):
raise TypeError("Direction must be one of \"i\", \"o\", \"io\", or \"oe\", not {!r}"""