Added setup script and fixes for building with py2

This commit is contained in:
2018-03-04 12:31:48 -06:00
parent b47d6efe45
commit 3b185ac77b
5 changed files with 2260 additions and 0 deletions

6
src/fixes/__init__.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
import sys
import fix_requests
def setup():
fix_requests.fix()

12
src/fixes/fix_requests.py Normal file
View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import requests
import os
import logging
from platform_utils import paths
log = logging.getLogger("fixes.fix_requests")
def fix():
log.debug("Applying fix for requests...")
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(paths.app_path(), "cacert.pem")
log.debug("Changed CA path to %s" % (os.environ["REQUESTS_CA_BUNDLE"],))