Skip to content

Commit c3c318a

Browse files
Fix: reverse ordeer
1 parent bd3f9a0 commit c3c318a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_cli_args.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ def _is_sys_platform_ne_win32(node: ast.AST) -> bool:
9191

9292

9393
def _is_debug_and_platform_guard(node: ast.AST) -> bool:
94-
"""True for ``args.debug and (sys.platform != "win32")``."""
94+
"""True for ``args.debug and (sys.platform != "win32")`` in either operand order."""
9595
if not isinstance(node, ast.BoolOp) or not isinstance(node.op, ast.And) or len(node.values) != 2:
9696
return False
97-
return _is_args_debug(node.values[0]) and _is_sys_platform_ne_win32(node.values[1])
97+
a, b = node.values
98+
return (_is_args_debug(a) and _is_sys_platform_ne_win32(b)) or (
99+
_is_args_debug(b) and _is_sys_platform_ne_win32(a)
100+
)
98101

99102

100103
def _use_reloader_kwarg_tied_to_debug(call: ast.Call) -> bool:

0 commit comments

Comments
 (0)