From d49de06d0c692365db272b980295cda8aebdc4c0 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Sat, 12 Sep 2026 12:06:43 -0400 Subject: [PATCH] Python Example: Update Python 2 syntax in Swagger example Update the legacy randomize_colors.py Swagger example to use Python 3 print syntax. The Python 2 print statements prevented Bandit from parsing the file during Codacy analysis and caused the analysis step to fail. Verified that all Python files in the repository compile successfully with Python 3. Signed-off-by: Robin Getz --- swagger/sdrangel/examples/randomize_colors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swagger/sdrangel/examples/randomize_colors.py b/swagger/sdrangel/examples/randomize_colors.py index eb3611339..a1c75ccd2 100755 --- a/swagger/sdrangel/examples/randomize_colors.py +++ b/swagger/sdrangel/examples/randomize_colors.py @@ -182,11 +182,11 @@ def main(): randomize_channels_colors(options, channels) # full randomization (identical to -Hsv) else: print("Error getting deviceset %d info. HTTP: %d" % (options.device_index, r.status_code)) - print json.dumps(r.json(), indent=4, sort_keys=True) + print(json.dumps(r.json(), indent=4, sort_keys=True)) except Exception as ex: tb = traceback.format_exc() - print >> sys.stderr, tb + print(tb, file=sys.stderr) if __name__ == "__main__":