1- import collections
1+ from collections import namedtuple
2+ try :
3+ from collections .abc import Sequence
4+ except ImportError :
5+ from collections import Sequence
26
37import six
48from nested_admin .tests .compat import python_2_unicode_compatible
@@ -18,7 +22,7 @@ def xpath_item(model_name=None):
1822
1923
2024def is_sequence (o ):
21- return isinstance (o , collections . Sequence )
25+ return isinstance (o , Sequence )
2226
2327
2428def is_integer (o ):
@@ -29,15 +33,15 @@ def is_str(o):
2933 return isinstance (o , six .string_types )
3034
3135
32- Position = collections . namedtuple ('Position' , ['x' , 'y' ])
36+ Position = namedtuple ('Position' , ['x' , 'y' ])
3337
3438
35- class Size (collections . namedtuple ('Size' , ['width' , 'height' ])):
39+ class Size (namedtuple ('Size' , ['width' , 'height' ])):
3640 w = property (lambda self : self .width )
3741 h = property (lambda self : self .height )
3842
3943
40- class Rect (collections . namedtuple ('Rect' , [
44+ class Rect (namedtuple ('Rect' , [
4145 'left' , 'top' , 'right' , 'bottom' , 'width' , 'height' , 'visible' ])):
4246 x = property (lambda self : self .left )
4347 y = property (lambda self : self .top )
0 commit comments