Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if config.args.offline:
config.args.local = True
if not config.args.local:
try:
# Submit to check50 repo.
import submit50
except ImportError:
raise InternalError(
"submit50 is not installed. Install submit50 and run check50 again.")
else:
submit50.handler.type = "check"
signal.signal(signal.SIGINT, submit50.handler)
submit50.run.verbose = config.args.verbose
username, commit_hash = submit50.submit("check50", identifier)
# Wait until payload comes back with check data.
print("Checking...", end="")
sys.stdout.flush()
pings = 0
while True:
# Terminate if no response.
if pings > 45:
print()
cprint("check50 is taking longer than normal!", "red", file=sys.stderr)
cprint("See https://legacy.cs50.me/checks/{} for more detail.".format(commit_hash),
"red", file=sys.stderr)
sys.exit(1)
pings += 1