Commit a38da01f authored by André Anjos's avatar André Anjos 💬

[python3] Use six module for py2/3 compatibility

parent 6375bfed
...@@ -9,6 +9,8 @@ probing. ...@@ -9,6 +9,8 @@ probing.
import os import os
import re import re
import sys
import six
import hashlib import hashlib
import random import random
...@@ -186,7 +188,7 @@ def qsub(command, queue=None, cwd=True, name=None, deps=[], stdout='', ...@@ -186,7 +188,7 @@ def qsub(command, queue=None, cwd=True, name=None, deps=[], stdout='',
if array is not None: if array is not None:
scmd.append('-t') scmd.append('-t')
if isinstance(array, (str, unicode)): if isinstance(array, six.string_types):
try: try:
i = int(array) i = int(array)
scmd.append('1-%d:1' % i) scmd.append('1-%d:1' % i)
......
...@@ -3,9 +3,9 @@ from setuptools import setup, find_packages ...@@ -3,9 +3,9 @@ from setuptools import setup, find_packages
import sys import sys
# If Python < 2.7 or 3.0 <= Python < 3.2, require some more stuff # If Python < 2.7 or 3.0 <= Python < 3.2, require some more stuff
ARGPARSE = [] DEPS = ['six']
if sys.version_info[:2] < (2, 7) or ((3,0) <= sys.version_info[:2] < (3,2)): if sys.version_info[:2] < (2, 7) or ((3,0) <= sys.version_info[:2] < (3,2)):
ARGPARSE.append('argparse') DEPS.append('argparse')
setup( setup(
name='gridtk', name='gridtk',
...@@ -40,7 +40,7 @@ setup( ...@@ -40,7 +40,7 @@ setup(
long_description=open('README.rst').read(), long_description=open('README.rst').read(),
install_requires=ARGPARSE, install_requires=DEPS,
classifiers = [ classifiers = [
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
......
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