File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import logging
2525
2626from cpython cimport pycapsule
2727from libc.stdint cimport uint64_t
28+ import collections.abc
2829
2930from ._backend cimport ( # noqa: E211
3031 DPCTLEvent_Copy,
@@ -199,14 +200,19 @@ cdef class SyclEventRaw(_SyclEventRaw):
199200
200201 @staticmethod
201202 def wait (event ):
202- if isinstance (event, list ):
203+ """ Waits for a given event or a sequence of events.
204+ """
205+ if (isinstance (event, collections.abc.Sequence) and
206+ all ( (isinstance (el, SyclEventRaw) for el in event) )):
203207 for e in event:
204208 SyclEventRaw._wait(e)
205209 elif isinstance (event, SyclEventRaw):
206210 SyclEventRaw._wait(event)
207211 else :
208- raise ValueError (" The passed argument is not a list \
209- or a SyclEventRaw type." )
212+ raise TypeError (
213+ " The passed argument is not a SyclEventRaw type or "
214+ " a sequence of such objects"
215+ )
210216
211217 def addressof_ref (self ):
212218 """ Returns the address of the C API `DPCTLSyclEventRef` pointer as
You can’t perform that action at this time.
0 commit comments