mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Fix scripts to work with both Python 2 and 3
This commit is contained in:
parent
b9f614c66f
commit
573ff3f2a6
2 changed files with 21 additions and 23 deletions
|
@ -18,7 +18,6 @@
|
|||
from __future__ import division
|
||||
from __future__ import unicode_literals
|
||||
from past.builtins import cmp
|
||||
from future import standard_library
|
||||
|
||||
from future.builtins import zip
|
||||
from future.builtins import str
|
||||
|
@ -1262,8 +1261,12 @@ def split_args(args=None):
|
|||
if isinstance(args, list):
|
||||
return args
|
||||
elif isinstance(args, str):
|
||||
return [arg.decode(plexpy.SYS_ENCODING, 'ignore')
|
||||
for arg in shlex.split(args.encode(plexpy.SYS_ENCODING, 'ignore'))]
|
||||
if plexpy.PYTHON_VERSION < 3:
|
||||
args = args.encode('utf-8')
|
||||
args = shlex.split(args)
|
||||
if plexpy.PYTHON_VERSION < 3:
|
||||
args = [a.decode('utf-8') for a in args]
|
||||
return args
|
||||
return []
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue