Skip to content

Commit

Permalink
Fix in flatten_list for Python 3.12 (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Sep 30, 2023
1 parent 019d0e9 commit 4444bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pingouin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ def _flatten_list(x, include_tuple=False):
# If x is not iterable, return x
if not isinstance(x, collections.abc.Iterable):
return x
# Remove None
x = list(filter(None.__ne__, x))
# Initialize empty output variable
result = []
# Loop over items in x
Expand All @@ -315,6 +313,8 @@ def _flatten_list(x, include_tuple=False):
result.append(el)
else:
result.append(el)
# Remove None from output
result = [r for r in result if r is not None]
return result


Expand Down

0 comments on commit 4444bd4

Please sign in to comment.