Skip to content

Commit 7bbd66b

Browse files
Treat SSL errors as not available (#605)
* Treat SSL errors as not available * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6803395 commit 7bbd66b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

grayskull/base/pkg_info.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ def is_pkg_available(pkg_name: str, channel: str = "conda-forge") -> bool:
1111
:param channel: Anaconda channel
1212
:return: Return True if the package is present on the given channel
1313
"""
14-
response = requests.get(
15-
url=f"https://anaconda.org/{channel}/{pkg_name}/files", allow_redirects=False
16-
)
14+
try:
15+
response = requests.get(
16+
url=f"https://anaconda.org/{channel}/{pkg_name}/files",
17+
allow_redirects=False,
18+
)
19+
except requests.exceptions.SSLError:
20+
return False
1721
return response.status_code == 200
1822

1923

0 commit comments

Comments
 (0)