Skip to content

Commit eb81ce1

Browse files
Merge pull request #2728 from tirkarthi/fix-warnings
Fix warning regarding ABC import from collections
2 parents ace6783 + 30d54a1 commit eb81ce1

File tree

1 file changed

+6
-2
lines changed
  • packages/python/plotly/plotly/figure_factory

1 file changed

+6
-2
lines changed

packages/python/plotly/plotly/figure_factory/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import absolute_import
22

3-
import collections
43
import decimal
54
import six
65

@@ -24,9 +23,14 @@
2423
validate_scale_values,
2524
)
2625

26+
try:
27+
from collections.abc import Sequence
28+
except ImportError:
29+
from collections import Sequence
30+
2731

2832
def is_sequence(obj):
29-
return isinstance(obj, collections.Sequence) and not isinstance(obj, str)
33+
return isinstance(obj, Sequence) and not isinstance(obj, str)
3034

3135

3236
def validate_index(index_vals):

0 commit comments

Comments
 (0)