Skip to content

Commit cbded24

Browse files
committed
ignore self-signed SSL errors and return None
1 parent fb93ead commit cbded24

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

bioconda_utils/bioconductor_skeleton.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,12 @@ def bioarchive_url(self):
468468
package, otherwise returns None.
469469
"""
470470
url = bioarchive_url(self.package, self.version, self.bioc_version)
471-
response = requests.head(url)
472-
if response.status_code == 200:
473-
return url
471+
try:
472+
response = requests.head(url)
473+
if response.status_code == 200:
474+
return url
475+
except requests.exceptions.SSLError:
476+
pass
474477

475478
@property
476479
def cargoport_url(self):
@@ -479,16 +482,19 @@ def cargoport_url(self):
479482
it exists.
480483
"""
481484
url = cargoport_url(self.package, self.version, self.bioc_version)
482-
response = requests.head(url)
483-
if response.status_code == 404:
484-
# This is expected if this is a new package or an updated version.
485-
# Cargo Port will archive a working URL upon merging
486-
return
487-
elif response.status_code == 200:
488-
return url
489-
else:
490-
raise PageNotFoundError(
491-
"Unexpected error: {0.status_code} ({0.reason})".format(response))
485+
try:
486+
response = requests.head(url)
487+
if response.status_code == 404:
488+
# This is expected if this is a new package or an updated version.
489+
# Cargo Port will archive a working URL upon merging
490+
return
491+
elif response.status_code == 200:
492+
return url
493+
else:
494+
raise PageNotFoundError(
495+
"Unexpected error: {0.status_code} ({0.reason})".format(response))
496+
except requests.exceptions.SSLError:
497+
pass
492498

493499
@property
494500
def bioconductor_tarball_url(self):

0 commit comments

Comments
 (0)