Skip to content

Commit 40f9059

Browse files
committed
Added more support for Python3
1 parent 20a6e87 commit 40f9059

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

smartdispatch/argument_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def unfold(self, match):
3535
start = int(groups[0])
3636
end = int(groups[1])
3737
step = 1 if groups[2] is None else int(groups[2])
38-
return map(str, range(start, end, step))
38+
return list(map(str, range(start, end, step)))
3939

4040

4141
argument_templates = build_argument_templates_dictionnary()

smartdispatch/smartdispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def unfold_command(command):
9797
pos = match.end()
9898

9999
arguments.append([text[pos:]]) # Add remaining unfolded arguments
100-
arguments = [map(utils.decode_escaped_characters, argvalues) for argvalues in arguments]
100+
arguments = [list(map(utils.decode_escaped_characters, argvalues)) for argvalues in arguments]
101101
return ["".join(argvalues) for argvalues in itertools.product(*arguments)]
102102

103103

smartdispatch/tests/test_smartdispatch.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import shutil
44
import time as t
55
from os.path import join as pjoin
6-
from StringIO import StringIO
6+
7+
try:
8+
from io import StringIO # Python 3
9+
except ImportError:
10+
from StringIO import StringIO # Python 2
711

812
import tempfile
913
from nose.tools import assert_true, assert_equal

0 commit comments

Comments
 (0)