Skip to content

Commit 33bbe57

Browse files
committed
Handle non-number/empty result
1 parent 11a1163 commit 33bbe57

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

windows-release/merge-and-upload.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ def find_missing_from_index(url, installs):
255255
if INDEX_FILE:
256256
INDEX_PATH = url2path(INDEX_URL)
257257

258-
INDEX_MTIME = int(call_ssh(["stat", "-c", "%Y", INDEX_PATH]) or 0)
258+
try:
259+
INDEX_MTIME = int(call_ssh(["stat", "-c", "%Y", INDEX_PATH]))
260+
except ValueError:
261+
pass
259262

260263
try:
261264
if not LOCAL_INDEX:
@@ -311,7 +314,10 @@ def find_missing_from_index(url, installs):
311314

312315
# Check that nobody else has published while we were uploading
313316
if INDEX_FILE and INDEX_MTIME:
314-
mtime = int(call_ssh(["stat", "-c", "%Y", INDEX_PATH]) or 0)
317+
try:
318+
mtime = int(call_ssh(["stat", "-c", "%Y", INDEX_PATH]))
319+
except ValueError:
320+
mtime = 0
315321
if mtime > INDEX_MTIME:
316322
print("##[error]Lost a race with another publish step!")
317323
print("Expecting mtime", INDEX_MTIME, "but saw", mtime)

0 commit comments

Comments
 (0)