Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 06cb7c4

Browse files
committed
actually use _have_ssl variable
1 parent ba93340 commit 06cb7c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

twitter/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
try:
77
import ssl
88
except ImportError:
9-
_have_ssl = False
9+
_HAVE_SSL = False
1010
else:
11-
_have_ssl = True
11+
_HAVE_SSL = True
1212

1313
try:
1414
import urllib.request as urllib_request
@@ -369,7 +369,7 @@ def _handle_response(self, req, uri, arg_data, _timeout=None, verify_context=Tru
369369
kwargs['timeout'] = _timeout
370370
try:
371371
context = None
372-
if not verify_context:
372+
if not verify_context and _HAVE_SSL:
373373
context = ssl._create_unverified_context()
374374
kwargs['context'] = context
375375
handle = urllib_request.urlopen(req, **kwargs)

0 commit comments

Comments
 (0)