mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Use newer is_sequence function instead of MutableSequence (#44331)
* Use newer is_sequence function instead of MutableSequence. Fixes #44327 * Add changelog for #44331 * Update changelog fragment to describe the fix in more detail
This commit is contained in:
@@ -34,7 +34,7 @@ import time
|
||||
import uuid
|
||||
import yaml
|
||||
|
||||
from collections import MutableMapping, MutableSequence
|
||||
from collections import MutableMapping
|
||||
import datetime
|
||||
from functools import partial
|
||||
from random import Random, SystemRandom, shuffle, random
|
||||
@@ -462,7 +462,7 @@ def flatten(mylist, levels=None):
|
||||
if element in (None, 'None', 'null'):
|
||||
# ignore undefined items
|
||||
break
|
||||
elif isinstance(element, MutableSequence):
|
||||
elif is_sequence(element):
|
||||
if levels is None:
|
||||
ret.extend(flatten(element))
|
||||
elif levels >= 1:
|
||||
|
||||
Reference in New Issue
Block a user