Commit be1b5fba authored by Yannick Roehlly's avatar Yannick Roehlly
Browse files

Make string detection compatible with Python 3.

Correction of a problem spotted by Médéric, basestring does not exists
in Python 3.
parent 0a508ac1
......@@ -28,10 +28,16 @@ def param_dict_combine(dictionary):
# First, we must ensure that all values are lists; when a value is a
# single element, we put it in a list.
# We must take a special care of strings, because they are iterable.
# We must take a special care of strings, because they are iterable. We
# define our own string_type to work both with Python 2 and Python 3.
try:
string_type = basestring
except NameError:
string_type = str
for key, value in dictionary.items():
if ((not isinstance(value, collections.Iterable)) or
isinstance(value, basestring)):
isinstance(value, string_type)):
dictionary[key] = [value]
# We use itertools.product to make all the possible combinations from the
......
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