Skip to content

Commit 2dd5529

Browse files
committed
Fix publish script due to crates.io CDN change
1 parent d2fbe57 commit 2dd5529

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

publish.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232

3333
def already_published(name, version):
3434
try:
35-
urllib.request.urlopen('https://crates.io/api/v1/crates/%s/%s/download' % (name, version))
35+
urllib.request.urlopen('https://static.crates.io/crates/%s/%s/download' % (name, version))
3636
except HTTPError as e:
37-
if e.code == 404:
37+
# 403 and 404 are common responses to assume it is not published
38+
if 400 <= e.code < 500:
3839
return False
3940
raise
4041
return True

0 commit comments

Comments
 (0)