mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-22 12:55:05 +00:00
Change prevent included py3 requests module failure on NZBGet systems that by default, run py2 with py2 requests.
This commit is contained in:
parent
312ed6519e
commit
048df31cf0
2 changed files with 9 additions and 2 deletions
|
@ -27,6 +27,7 @@
|
||||||
* Update tmdbsimple 2.6.6 (679e343) to 2.9.1 (9da400a)
|
* Update tmdbsimple 2.6.6 (679e343) to 2.9.1 (9da400a)
|
||||||
* Update torrent_parser 0.3.0 (2a4eecb) to 0.4.0 (23b9e11)
|
* Update torrent_parser 0.3.0 (2a4eecb) to 0.4.0 (23b9e11)
|
||||||
* Update unidecode module 1.1.1 (632af82) to 1.3.6 (4141992)
|
* Update unidecode module 1.1.1 (632af82) to 1.3.6 (4141992)
|
||||||
|
* Change prevent included py3 requests module failure on NZBGet systems that by default, run py2 with py2 requests
|
||||||
* Change prevent included py3 requests module failure on SABnzbd systems that by default, run py2 with py2 requests
|
* Change prevent included py3 requests module failure on SABnzbd systems that by default, run py2 with py2 requests
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
# Send "Process Media" requests to SickGear
|
# Send "Process Media" requests to SickGear
|
||||||
#
|
#
|
||||||
# Process Media extension version: 2.7.
|
# Process Media extension version: 2.8.
|
||||||
# <!--
|
# <!--
|
||||||
# For more info and updates please visit forum topic at
|
# For more info and updates please visit forum topic at
|
||||||
# -->
|
# -->
|
||||||
|
@ -444,13 +444,19 @@ if not sg_path or not Ek.ek(os.path.isdir, sg_path):
|
||||||
sg_path = Ek.ek(os.path.dirname, Ek.ek(os.path.dirname, script_path))
|
sg_path = Ek.ek(os.path.dirname, Ek.ek(os.path.dirname, script_path))
|
||||||
except (BaseException, Exception):
|
except (BaseException, Exception):
|
||||||
pass
|
pass
|
||||||
if sg_path and Ek.ek(os.path.isdir, Ek.ek(os.path.join, sg_path, 'lib')):
|
if not PY2 and sg_path and Ek.ek(os.path.isdir, Ek.ek(os.path.join, sg_path, 'lib')):
|
||||||
sys.path.insert(1, Ek.ek(os.path.join, sg_path, 'lib'))
|
sys.path.insert(1, Ek.ek(os.path.join, sg_path, 'lib'))
|
||||||
|
|
||||||
|
|
||||||
|
py_msg = 'Python 3 %s be set to run python files instead of the current Python 2.'
|
||||||
try:
|
try:
|
||||||
import requests
|
import requests
|
||||||
|
if PY2:
|
||||||
|
Logger.log(py_msg % 'should', Logger.WARNING)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
if PY2:
|
||||||
|
Logger.log(py_msg % 'must', Logger.ERROR)
|
||||||
|
sys.exit(1)
|
||||||
# Logger.log('You must set SickGear sg_base_path in script config or install python requests library', Logger.ERROR)
|
# Logger.log('You must set SickGear sg_base_path in script config or install python requests library', Logger.ERROR)
|
||||||
Logger.log('You must install python requests library', Logger.ERROR)
|
Logger.log('You must install python requests library', Logger.ERROR)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in a new issue