mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
The requests fix is applied in non-frozen copies of TWBlue too. In this case, only the proxy is patched
This commit is contained in:
parent
607da14355
commit
3a4b34972d
@ -9,5 +9,7 @@ def setup():
|
||||
fix_arrow.fix()
|
||||
if hasattr(sys, "frozen"):
|
||||
fix_win32com.fix()
|
||||
fix_requests.fix()
|
||||
fix_requests.fix(True)
|
||||
else:
|
||||
fix_requests.fix(False)
|
||||
fix_urllib3_warnings.fix()
|
@ -7,11 +7,14 @@ orig_session_init=requests.sessions.Session.__init__
|
||||
def patched_where():
|
||||
return paths.app_path(u"cacert.pem")
|
||||
|
||||
def fix():
|
||||
certs.where=patched_where
|
||||
utils.DEFAULT_CA_BUNDLE_PATH=patched_where()
|
||||
adapters.DEFAULT_CA_BUNDLE_PATH=patched_where()
|
||||
def fix(frozen):
|
||||
if frozen==True:
|
||||
certs.where=patched_where
|
||||
utils.DEFAULT_CA_BUNDLE_PATH=patched_where()
|
||||
adapters.DEFAULT_CA_BUNDLE_PATH=patched_where()
|
||||
requests.sessions.Session.__init__=patched_session_init
|
||||
requests.Session.__init__=patched_session_init
|
||||
requests.session.__init__=patched_session_init
|
||||
|
||||
def patched_session_init(self):
|
||||
orig_session_init(self)
|
||||
|
Loading…
Reference in New Issue
Block a user