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:
Matt Martz
2018-08-21 10:42:11 -05:00
committed by GitHub
parent dcc4a38f98
commit 2bf6507c44
3 changed files with 6 additions and 2 deletions

View File

@@ -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: