From 788e8b7eccea38167caf8d6d5baab52cf9f9c872 Mon Sep 17 00:00:00 2001 From: Joe Harrison Date: Fri, 21 Feb 2020 13:37:43 +0000 Subject: [PATCH] Remove potentially undefined exit behaviour from analyzesize tool Python2.7 doc for `sys` module states that "Most systems require [the exit code] to be in the range 0-127, and produce undefined results otherwise". Currently, modern Linux-based systems will exit with code 255, while msys2-based systems such as Proxspace will exit with code 127. Instead, explicitly exit with non-zero exit code of 1. --- tools/analyzesize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/analyzesize.py b/tools/analyzesize.py index 889222c01..37024f939 100755 --- a/tools/analyzesize.py +++ b/tools/analyzesize.py @@ -17,7 +17,7 @@ except FileNotFoundError: if len(sys.argv) < 3: print("Usage: analyzesize.py ") - exit(-1) + exit(2) action, name = sys.argv[1:3] currentdata = subprocess.run(["arm-none-eabi-size","armsrc/obj/fullimage.stage1.elf"], stdout=subprocess.PIPE).stdout currentdata = currentdata.split(b"\n")[1].strip()