Skip to content

Commit

Permalink
commented back in pycurl
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Fleming authored and Matt Fleming committed Feb 5, 2025
1 parent 6e72434 commit 99d1fb2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions trafilatura/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
except ImportError:
PROXY_URL = None

#try:
import pycurl # type: ignore

CURL_SHARE = pycurl.CurlShare()
# available options:
# https://curl.se/libcurl/c/curl_share_setopt.html
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_DNS)
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_SSL_SESSION)
# not thread-safe
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_CONNECT)
HAS_PYCURL = True
#except ImportError:
#HAS_PYCURL = False
try:
import pycurl # type: ignore

CURL_SHARE = pycurl.CurlShare()
# available options:
# https://curl.se/libcurl/c/curl_share_setopt.html
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_DNS)
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_SSL_SESSION)
# not thread-safe
CURL_SHARE.setopt(pycurl.SH_SHARE, pycurl.LOCK_DATA_CONNECT)
HAS_PYCURL = True
except ImportError:
HAS_PYCURL = False

LOGGER = logging.getLogger(__name__)

Expand Down

0 comments on commit 99d1fb2

Please sign in to comment.