Commit 4f6221ca authored by André Anjos's avatar André Anjos 💬

[python3] string class comparison using six

parent a38da01f
......@@ -8,6 +8,7 @@
import os
import sys
import six
import signal
import subprocess
from .tools import logger
......@@ -88,7 +89,7 @@ def environ(context):
def sexec(context, command, error_on_nonzero=True):
"""Executes a command within a particular Idiap SETSHELL context"""
if isinstance(context, (str, unicode)): E = environ(context)
if isinstance(context, six.string_types): E = environ(context)
else: E = context
try:
......
......@@ -139,7 +139,7 @@ def qsub(command, queue=None, cwd=True, name=None, deps=[], stdout='',
scmd = ['qsub']
if isinstance(queue, str) and queue not in ('all.q', 'default'):
if isinstance(queue, six.string_types) and queue not in ('all.q', 'default'):
scmd += ['-l', queue]
if mem:
......@@ -195,7 +195,7 @@ def qsub(command, queue=None, cwd=True, name=None, deps=[], stdout='',
except ValueError:
#must be complete...
scmd.append('%s' % array)
if isinstance(array, (int, long)):
if isinstance(array, six.integer_types):
scmd.append('1-%d:1' % array)
if isinstance(array, (tuple, list)):
if len(array) < 1 or len(array) > 3:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment