From 9c8a3d628ace32f3782f7fc418cd44ad8260fec0 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Thu, 1 Mar 2018 01:08:26 +0000 Subject: [PATCH] Handle hard dependency on certifi in requests>=2.16 --- EDMC.py | 4 ++-- companion.py | 4 ++-- setup.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EDMC.py b/EDMC.py index 6a4cb39d..ae47de82 100755 --- a/EDMC.py +++ b/EDMC.py @@ -54,8 +54,8 @@ try: parser.add_argument('-j', help=argparse.SUPPRESS) # Import JSON dump args = parser.parse_args() - if sys.platform=='win32' and getattr(sys, 'frozen', False): - os.environ['REQUESTS_CA_BUNDLE'] = join(dirname(sys.executable), 'cacert.pem') + if getattr(sys, 'frozen', False): + os.environ['REQUESTS_CA_BUNDLE'] = join(config.respath, 'cacert.pem') if args.version: latest = '' diff --git a/companion.py b/companion.py index 858f9180..13a574bb 100644 --- a/companion.py +++ b/companion.py @@ -157,8 +157,8 @@ class Session: from requests.packages import urllib3 urllib3.disable_warnings() - if platform=='win32' and getattr(sys, 'frozen', False): - os.environ['REQUESTS_CA_BUNDLE'] = join(dirname(sys.executable), 'cacert.pem') + if getattr(sys, 'frozen', False): + os.environ['REQUESTS_CA_BUNDLE'] = join(config.respath, 'cacert.pem') def login(self, username=None, password=None, is_beta=False): if (not username or not password): diff --git a/setup.py b/setup.py index a85fea85..c6b03e17 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ import re import shutil import sys from tempfile import gettempdir +import requests from config import appname as APPNAME, applongname as APPLONGNAME, appcmdname as APPCMDNAME, appversion as VERSION from config import update_feed, update_interval @@ -73,10 +74,10 @@ if sys.platform=='darwin': 'optimize': 2, 'packages': [ 'requests', 'keyring.backends' ], 'frameworks': [ 'Sparkle.framework' ], - 'excludes': [ 'certifi', 'distutils', 'iniparse', '_markerlib', 'PIL', 'pkg_resources', 'simplejson', 'unittest' ], + 'excludes': [ 'distutils', 'iniparse', '_markerlib', 'PIL', 'pkg_resources', 'simplejson', 'unittest' ], 'iconfile': '%s.icns' % APPNAME, 'include_plugins': [('plugins', x) for x in PLUGINS], - 'resources': ['commodity.csv', 'snd_good.wav', 'snd_bad.wav', 'modules.p', 'ships.p', 'stations.p', 'systems.p'], + 'resources': [ requests.certs.where(), 'commodity.csv', 'snd_good.wav', 'snd_bad.wav', 'modules.p', 'ships.p', 'stations.p', 'systems.p'], 'semi_standalone': True, 'site_packages': False, 'plist': { @@ -106,11 +107,10 @@ elif sys.platform=='win32': 'requests', 'keyring.backends', 'shutil', 'sqlite3', 'zipfile', # Included for plugins ], - 'excludes': [ 'certifi', 'distutils', 'iniparse', '_markerlib', 'optparse', 'PIL', 'pkg_resources', 'simplejson', 'unittest' ], + 'excludes': [ 'distutils', 'iniparse', '_markerlib', 'optparse', 'PIL', 'pkg_resources', 'simplejson', 'unittest' ], } } - import requests DATA_FILES = [ ('', [ requests.certs.where(),