From 01efd27e07ba56e2722588b29c2d8bd06a45844f Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Thu, 11 Jan 2024 23:03:45 +0300 Subject: [PATCH] bytebeat_compiler.py: fix `None` value bug --- bytebeat_compiler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 4e14217..15271e1 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -162,6 +162,8 @@ if __name__ == "__main__": final_sample_rate_code = f"w /= {sample_rate_ratio}L;" args.sample_rate = args.final_sample_rate + final_sample_rate = \ + value if (value := args.final_sample_rate) else original_sample_rate samples = 0 while True: no_seconds = args.seconds is None or args.seconds == 0 @@ -176,9 +178,9 @@ if __name__ == "__main__": if no_seconds and samples_exist: samples = args.samples elif seconds_exist and samples_exist: - samples = args.seconds * args.final_sample_rate + args.samples + samples = args.seconds * final_sample_rate + args.samples elif seconds_exist and no_samples: - samples = args.seconds * args.final_sample_rate + samples = args.seconds * final_sample_rate elif no_seconds and no_samples: args.seconds = 30 # default continue