summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2020-02-16 10:37:55 -0500
committerLouis Vézina <[email protected]>2020-02-16 10:37:55 -0500
commitcc61d0188f33d33121b95564d9b55d486d5d4544 (patch)
tree15e84536f8b195a55184f0264688622d61983460
parent7d881e6de9d47ed786e2d59a337f0d4f022ab0a3 (diff)
downloadbazarr-cc61d0188f33d33121b95564d9b55d486d5d4544.tar.gz
bazarr-cc61d0188f33d33121b95564d9b55d486d5d4544.zip
Fix for Python 2.7 compatibility regression.
-rw-r--r--bazarr.py5
-rw-r--r--libs/subliminal_patch/providers/subdivx.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/bazarr.py b/bazarr.py
index be643ec23..8f1b7da03 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -117,7 +117,10 @@ def start_bazarr(process_registry=ProcessRegistry()):
script = [sys.executable, "-u", os.path.normcase(os.path.join(dir_name, 'bazarr', 'main.py'))] + sys.argv[1:]
print("Bazarr starting...")
- ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL)
+ if PY3:
+ ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL)
+ else:
+ ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=None)
process_registry.register(ep)
try:
ep.wait()
diff --git a/libs/subliminal_patch/providers/subdivx.py b/libs/subliminal_patch/providers/subdivx.py
index d9339e9ae..69202ec88 100644
--- a/libs/subliminal_patch/providers/subdivx.py
+++ b/libs/subliminal_patch/providers/subdivx.py
@@ -9,7 +9,11 @@ import zipfile
import rarfile
from subzero.language import Language
from requests import Session
-from urllib.parse import urlparse
+from six import PY2
+if PY2:
+ from urlparse import urlparse
+else:
+ from urllib.parse import urlparse
from subliminal import __short_version__
from subliminal.exceptions import ServiceUnavailable