Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit d602778

Browse files
matt-phylummaxrake
andcommitted
fix lints
Co-authored-by: Charles Coggins <maxrake@users.noreply.github.com>
1 parent e3b5a7e commit d602778

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/upload.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Script to upload a set of policy files to Phylum.
33
"""
44

5+
import contextlib
56
import io
67
import json
78
import os
@@ -11,6 +12,7 @@
1112
from urllib.parse import quote
1213
from urllib.request import Request, urlopen
1314
import uuid
15+
import sys
1416

1517
# Set the group name if you are uploading policies for a group.
1618
GROUP_NAME = None
@@ -64,11 +66,9 @@
6466
pass
6567
except HTTPError as error:
6668
response = error.read().decode("utf8", errors="replace")
67-
try:
69+
with contextlib.suppress(json.JSONDecodeError):
6870
# Phylum's API returns JSON error descriptions.
6971
# If that's what we got, reformat it to be more readable.
7072
response = json.dumps(json.loads(response), indent=2)
71-
except json.JSONDecodeError:
72-
pass
7373
print(response)
74-
exit(1)
74+
sys.exit(1)

0 commit comments

Comments
 (0)