|
|
@@ -44,6 +44,9 @@ def get(url: str, *, json=True, headers=None, expiry=datetime.timedelta(minutes=
|
|
|
pass # fall through
|
|
|
|
|
|
r = get_with_retries(url, headers)
|
|
|
+ if r.status_code == 204:
|
|
|
+ raise NoContent
|
|
|
+
|
|
|
cache_path.parent.mkdir(parents=True, exist_ok=True)
|
|
|
with lzma.open(cache_path, 'wb') as f:
|
|
|
if json:
|
|
|
@@ -64,3 +67,6 @@ def get_with_retries(url: str, headers: httpx._types.HeaderTypes|None=None) -> h
|
|
|
else:
|
|
|
print(url, 'attempt', attempt+1, 'timed out; retrying...')
|
|
|
raise AssertionError
|
|
|
+
|
|
|
+class NoContent(Exception):
|
|
|
+ pass
|