Skip to content

Commit e4edee2

Browse files
committed
simplify code by passing boolean value
1 parent df9840f commit e4edee2

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

fastmath.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,10 @@ def check_fastmath():
3333
return
3434

3535

36-
parser = argparse.ArgumentParser()
37-
parser.add_argument("--perform", required=True)
38-
EXCEPTED_VALUES = ["check"]
39-
40-
args = parser.parse_args()
41-
if args.perform not in EXCEPTED_VALUES:
42-
raise ValueError("Invalid argument")
43-
44-
if args.perform == "check":
45-
check_fastmath()
46-
else:
47-
pass
36+
if __name__ == "__main__":
37+
parser = argparse.ArgumentParser()
38+
parser.add_argument("--check", action="store_true")
39+
args = parser.parse_args()
40+
41+
if args.check:
42+
check_fastmath()

0 commit comments

Comments
 (0)