Skip to content

Commit 945f8cc

Browse files
committed
Fix warning regarding ABC import from collections
1 parent 9fab582 commit 945f8cc

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

Lines changed: 5 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,13 @@
2423
validate_scale_values,
2524
)
2625

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

2831
def is_sequence(obj):
29-
return isinstance(obj, collections.Sequence) and not isinstance(obj, str)
32+
return isinstance(obj, Sequence) and not isinstance(obj, str)
3033

3134

3235
def validate_index(index_vals):

0 commit comments

Comments
 (0)