Coverage for cuda / pathfinder / _utils / platform_aware.py: 100.00%
8 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-08 01:07 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-08 01:07 +0000
1# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
4import sys
6IS_WINDOWS = sys.platform == "win32"
9def quote_for_shell(s: str) -> str:
10 if IS_WINDOWS: 1abcdelmfghij
11 # This is a relatively heavy import; keep pathfinder lean if possible.
12 from subprocess import list2cmdline 1abcdefghij
14 return list2cmdline([s]) 1abcdefghij
15 else:
16 import shlex 1abcdelmfghij
18 return shlex.quote(s) 1abcdelmfghij