mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-03 21:34:30 +08:00
Reverted the refactoring of flatten; generator wasn't unpacking (of
course), and caused an infinite loop.
This commit is contained in:
@@ -462,8 +462,9 @@ def flatten( seq ):
|
||||
"""
|
||||
Flatten a possible nested set of iterables
|
||||
"""
|
||||
if isinstance( seq, ( types.GeneratorType, list, tuple ) ):
|
||||
for y in flatten( seq ):
|
||||
yield smart_str(y)
|
||||
else:
|
||||
yield smart_str(seq)
|
||||
for x in seq:
|
||||
if isinstance( x, ( types.GeneratorType, list, tuple ) ):
|
||||
for y in flatten( x ):
|
||||
yield smart_str( y )
|
||||
else:
|
||||
yield smart_str( x )
|
||||
|
||||
Reference in New Issue
Block a user