Commit aba9beef authored by Daniel Silverstone's avatar Daniel Silverstone
Browse files

_yaml.py: use `in (a,b)` to simply boolean checks

Where we use a construct `val == foo or val == bar` we can instead use
`val in (foo, bar)` which pylint prefers.

Signed-off-by: default avatarDaniel Silverstone <daniel.silverstone@codethink.co.uk>
parent 5693f557
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -395,9 +395,9 @@ def node_get(node, expected_type, key, indices=None, default_value=_get_sentinel
        try:
        try:
            if (expected_type == bool and isinstance(value, str)):
            if (expected_type == bool and isinstance(value, str)):
                # Dont coerce booleans to string, this makes "False" strings evaluate to True
                # Dont coerce booleans to string, this makes "False" strings evaluate to True
                if value == 'true' or value == 'True':
                if value in ('True', 'true'):
                    value = True
                    value = True
                elif value == 'false' or value == 'False':
                elif value in ('False', 'false'):
                    value = False
                    value = False
                else:
                else:
                    raise ValueError()
                    raise ValueError()