Skip to content

Commit cd80409

Browse files
committed
Expand non replacement check to bool types
We also need to avoid trying to parse bool types when not replacing as they may be unsubstituted variables that are not a valid bool type. Just don't check them if we are not replacing and use the default value instead.
1 parent 2d94d80 commit cd80409

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ def test_reproduce_issue595(self, newconfig):
352352
setenv = DONTCARE = 0
353353
[testenv:eggs]
354354
setenv = {[testenv]setenv}
355+
sitepackages = {[testenv]sitepackages}
355356
""")
356357
assert config.envlist == ['spam']
357358

tox/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ def _getdict(self, value, default, sep, replace=True):
980980

981981
def getbool(self, name, default=None, replace=True):
982982
s = self.getstring(name, default, replace=replace)
983-
if not s:
983+
if not s or not replace:
984984
s = default
985985
if s is None:
986986
raise KeyError("no config value [%s] %s found" % (

0 commit comments

Comments
 (0)