Skip to content

Commit fa7da9f

Browse files
committed
Update generated validation code for pyproject.toml
1 parent 0a8f477 commit fa7da9f

File tree

3 files changed

+48
-29
lines changed

3 files changed

+48
-29
lines changed

setuptools/config/_validate_pyproject/error_reporting.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import typing
77
from contextlib import contextmanager
88
from textwrap import indent, wrap
9-
from typing import Any, Dict, Generator, Iterator, List, Optional, Sequence, Union, cast
9+
from typing import Any, Dict, Generator, Iterator, List, Optional, Sequence, Union
1010

1111
from .fastjsonschema_exceptions import JsonSchemaValueException
1212

@@ -316,9 +316,7 @@ def _label(self, path: Sequence[str]) -> str:
316316
def _value(self, value: Any, path: Sequence[str]) -> str:
317317
if path[-1] == "type" and not self._is_property(path):
318318
type_ = self._jargon(value)
319-
return (
320-
f"[{', '.join(type_)}]" if isinstance(value, list) else cast(str, type_)
321-
)
319+
return f"[{', '.join(type_)}]" if isinstance(type_, list) else type_
322320
return repr(value)
323321

324322
def _inline_attrs(self, schema: dict, path: Sequence[str]) -> Iterator[str]:

0 commit comments

Comments
 (0)