Skip to content

Commit 28ab7dc

Browse files
committed
Change type of exception raised by values.Formatter
`NotImplementedError` isn't really applicable when the condition is more permanent as it hinges on the specification. A `TypeError` is more correct here, since it's the _type_ of the token that is the issue in these cases.
1 parent b930beb commit 28ab7dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/csspring/values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _(self, production: RepetitionProduction) -> Iterable[str]:
176176
def _(self, production: TokenProduction) -> Iterable[str]:
177177
if production.attributes:
178178
if 'value' not in production.attributes or len(production.attributes) > 1:
179-
raise NotImplementedError # the "Values and Units" specification doesn't feature token productions with matching of attributes other than `value`
179+
raise TypeError # the "Values and Units" specification doesn't feature token productions with matching of attributes other than `value`
180180
yield repr(production.attributes['value'])
181181
else:
182182
if hasattr(production.type, 'value'):

0 commit comments

Comments
 (0)