Commit fbce402c authored by Petr Tuma's avatar Petr Tuma Committed by Lubomir Bulej

Minor changes to the script to use Python 3.

parent a7bc3130
#!/usr/bin/env python #!/usr/bin/env python3
import argparse import argparse
import itertools import itertools
...@@ -306,12 +306,12 @@ def flatten_all(object): ...@@ -306,12 +306,12 @@ def flatten_all(object):
if object is None: if object is None:
return None return None
if isinstance(object, basestring): if isinstance(object, str):
return [object] return [object]
result = [] result = []
for x in object: for x in object:
if hasattr(x, "__iter__") and not isinstance(x, basestring): if hasattr(x, "__iter__") and not isinstance(x, str):
result.extend(flatten_all(x)) result.extend(flatten_all(x))
else: else:
result.append(x) result.append(x)
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