Skip to content

Commit e4cabe8

Browse files
committed
Removing INI-specific check from TOML internal replacer function
1 parent c0356a1 commit e4cabe8

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/tox/config/loader/toml/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,14 @@ def build( # noqa: PLR0913
6868
delay_replace = inspect.isclass(of_type) and issubclass(of_type, SetEnv)
6969

7070
def replacer(raw_: str, args_: ConfigLoadArgs) -> str:
71-
if conf is None:
72-
replaced = raw_ # no replacement supported in the core section
73-
else:
74-
reference_replacer = Unroll(conf, self, args)
75-
try:
76-
replaced = str(reference_replacer(raw_)) # do replacements
77-
except Exception as exception:
78-
if isinstance(exception, HandledError):
79-
raise
80-
msg = f"replace failed in {args_.env_name}.{key} with {exception!r}"
81-
raise HandledError(msg) from exception
71+
reference_replacer = Unroll(conf, self, args)
72+
try:
73+
replaced = str(reference_replacer(raw_)) # do replacements
74+
except Exception as exception:
75+
if isinstance(exception, HandledError):
76+
raise
77+
msg = f"replace failed in {args_.env_name}.{key} with {exception!r}"
78+
raise HandledError(msg) from exception
8279
return replaced
8380

8481
exploded = Unroll(conf=conf, loader=self, args=args)(raw)

0 commit comments

Comments
 (0)