Skip to content

Commit 5a447a9

Browse files
committed
Handle cases where there is no output from the check command
According to the docs `TimeoutExpired.output` may be `None` if there was no output from the command.
1 parent 0cc5e3e commit 5a447a9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

extra_data/cli/check_readable.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def monitor_access_check(path):
113113
timeout=args.timeout, capture_output=True,
114114
env={'OMP_NUM_THREADS': '1'})
115115
except subprocess.TimeoutExpired as e:
116-
path_states[path] = e.stdout.decode().splitlines()[-1]
116+
if e.stdout is None:
117+
path_states[path] = "Status unknown, no output from check command"
118+
else:
119+
path_states[path] = e.stdout.decode().splitlines()[-1]
117120
return 'T'
118121
else:
119122
path_states[path] = p.stdout.decode().splitlines()[-1]
@@ -158,4 +161,4 @@ def monitor_access_check(path):
158161

159162

160163
if __name__ == '__main__':
161-
sys.exit(main())
164+
sys.exit(main())

0 commit comments

Comments
 (0)