aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-12-13 17:29:50 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-12-14 01:09:47 +0100
commit5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488 (patch)
tree8bee771d16556051cd603f69c222e3407a19c17f /src
parent1f1361a3cae0bcaf82ee96d0736ed23b7763127c (diff)
downloadallocbench-5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488.tar.gz
allocbench-5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488.zip
use sys.exit instead of exit and other small code improvements
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chattyparser.py4
-rw-r--r--src/util.py5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/chattyparser.py b/src/chattyparser.py
index 0bd6821..3c64ed7 100755
--- a/src/chattyparser.py
+++ b/src/chattyparser.py
@@ -227,12 +227,12 @@ if __name__ == "__main__":
if "--license" in sys.argv:
print("Copyright (C) 2018-2019 Florian Fischer")
print("License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>")
- exit(0)
+ sys.exit(0)
if len(sys.argv) != 2 or sys.argv[1] in ["-h", "--help"]:
print("chattyparser: parse chattymalloc output and",
"create size histogram and memory profile", file=sys.stderr)
print(f"Usage: {sys.argv[0]} chattymalloc-file", file=sys.stderr)
- exit(1)
+ sys.exit(1)
plot(sys.argv[1])
diff --git a/src/util.py b/src/util.py
index 04a4a0c..b095f1a 100644
--- a/src/util.py
+++ b/src/util.py
@@ -93,8 +93,7 @@ def prefix_cmd_with_abspath(cmd):
# add arguments of cmd to the abspath
if binary_end:
return binary_abspath + " " + cmd[binary_end:]
- else:
- return binary_abspath
+ return binary_abspath
def allocbench_msg(color, *objects, sep=' ', end='\n', file=sys.stdout):
@@ -168,7 +167,7 @@ def print_license_and_exit():
print("Copyright (C) 2018-2019 Florian Fischer")
print(
"License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>")
- exit(0)
+ sys.exit(0)
def sha1sum(filename):