35
35
terminal if any of its Phases or further nested PhaseGroups are also terminal.
36
36
"""
37
37
38
- import collections
39
38
import functools
40
39
41
40
import mutablerecords
42
41
43
42
from openhtf .core import phase_descriptor
44
43
from openhtf .core import test_record
44
+ from six .moves import collections_abc
45
45
46
46
47
47
class PhaseGroup (mutablerecords .Record (
@@ -130,7 +130,7 @@ def combine(self, other, name=None):
130
130
def wrap (self , main_phases , name = None ):
131
131
"""Returns PhaseGroup with additional main phases."""
132
132
new_main = list (self .main )
133
- if isinstance (main_phases , collections .Iterable ):
133
+ if isinstance (main_phases , collections_abc .Iterable ):
134
134
new_main .extend (main_phases )
135
135
else :
136
136
new_main .append (main_phases )
@@ -212,7 +212,7 @@ def flatten_phases_and_groups(phases_or_groups):
212
212
for phase in phases_or_groups :
213
213
if isinstance (phase , PhaseGroup ):
214
214
ret .append (phase .flatten ())
215
- elif isinstance (phase , collections .Iterable ):
215
+ elif isinstance (phase , collections_abc .Iterable ):
216
216
ret .extend (flatten_phases_and_groups (phase ))
217
217
else :
218
218
ret .append (phase_descriptor .PhaseDescriptor .wrap_or_copy (phase ))
@@ -236,7 +236,7 @@ def optionally_with_args(phase, **kwargs):
236
236
"""
237
237
if isinstance (phase , PhaseGroup ):
238
238
return phase .with_args (** kwargs )
239
- if isinstance (phase , collections .Iterable ):
239
+ if isinstance (phase , collections_abc .Iterable ):
240
240
return [optionally_with_args (p , ** kwargs ) for p in phase ]
241
241
242
242
if not isinstance (phase , phase_descriptor .PhaseDescriptor ):
@@ -267,7 +267,7 @@ def optionally_with_plugs(phase, **subplugs):
267
267
"""
268
268
if isinstance (phase , PhaseGroup ):
269
269
return phase .with_plugs (** subplugs )
270
- if isinstance (phase , collections .Iterable ):
270
+ if isinstance (phase , collections_abc .Iterable ):
271
271
return [optionally_with_plugs (p , ** subplugs ) for p in phase ]
272
272
273
273
if not isinstance (phase , phase_descriptor .PhaseDescriptor ):
0 commit comments