Browse Source

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 <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 2 months ago
parent
commit
d49de06d0c
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 4
      swagger/sdrangel/examples/randomize_colors.py

4
swagger/sdrangel/examples/randomize_colors.py

@ -182,11 +182,11 @@ def main(): @@ -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__":

Loading…
Cancel
Save