Skip to content

Commit

Permalink
roll back the try/except on httplib (regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Apr 28, 2024
1 parent 211416e commit 73bb489
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions easydev/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#
##############################################################################
"""Utilities related to the web"""
import http
try:
import httplib
except ImportError:
import http.client as httplib

__all__ = ["isurl_reachable"]

Expand All @@ -33,7 +36,7 @@ def isurl_reachable(url, timeout=10, path="/"): # pragma: no cover
"""
if url.startswith("http://") or url.startswith("https://"):
url = url.split("//")[1]
conn = http.client.HTTPConnection(url, timeout=timeout)
conn = httplib.HTTPConnection(url, timeout=timeout)
try:
conn.request("HEAD", path)
except:
Expand Down

0 comments on commit 73bb489

Please sign in to comment.