Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
new_code = fix_code(code, file=file, max_line_length=args.max_line_length,
verbose=args.verbose, quiet=args.quiet, allow_dynamic=args.allow_dynamic)
except (RuntimeError, NotImplementedError) as e:
if not args.quiet:
print(f"Error with {file}: {e}", file=sys.stderr)
continue
if new_code != code:
if args.in_place:
with open(file, 'w') as f:
f.write(new_code)
else:
print(get_diff_text(io.StringIO(code).readlines(),
io.StringIO(new_code).readlines(), file))