1275 ctypes.windll.kernel32.SetErrorMode(oldMode) |
1275 ctypes.windll.kernel32.SetErrorMode(oldMode) |
1276 else: |
1276 else: |
1277 # we are on a Linux or macOS platform |
1277 # we are on a Linux or macOS platform |
1278 for mountCommand in ["mount", "/sbin/mount", "/usr/sbin/mount"]: |
1278 for mountCommand in ["mount", "/sbin/mount", "/usr/sbin/mount"]: |
1279 with contextlib.suppress(FileNotFoundError): |
1279 with contextlib.suppress(FileNotFoundError): |
1280 mountOutput = ( |
1280 mountOutput = subprocess.run( # secok |
1281 subprocess.check_output(mountCommand).splitlines() # secok |
1281 mountCommand, check=True, capture_output=True, text=True |
1282 ) |
1282 ).stdout.splitlines() |
1283 mountedVolumes = [ |
1283 mountedVolumes = [ |
1284 x.decode("utf-8").split(" type")[0].split(maxsplit=2)[2] |
1284 x.split(" type")[0].split(maxsplit=2)[2] |
1285 for x in mountOutput |
1285 for x in mountOutput |
1286 ] |
1286 ] |
1287 if findAll: |
1287 if findAll: |
1288 for volume in mountedVolumes: |
1288 for volume in mountedVolumes: |
1289 if volumeName in volume: |
1289 if volumeName in volume: |