Set PYTHON2 global variable

This commit is contained in:
JonnyWong16 2020-04-04 07:57:51 -07:00
parent fb395fc2e9
commit 9e0153e962
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
35 changed files with 43 additions and 42 deletions

View file

@ -60,7 +60,7 @@ from xml.dom import minidom
import xmltodict
import plexpy
if plexpy.PYTHON_VERSION < 3:
if plexpy.PYTHON2:
import logger
import request
from api2 import API2
@ -1265,10 +1265,10 @@ def split_args(args=None):
if isinstance(args, list):
return args
elif isinstance(args, str):
if plexpy.PYTHON_VERSION < 3:
if plexpy.PYTHON2:
args = args.encode('utf-8')
args = shlex.split(args)
if plexpy.PYTHON_VERSION < 3:
if plexpy.PYTHON2:
args = [a.decode('utf-8') for a in args]
return args
return []