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,
@@ -206,14 +207,19 @@ cdef class SyclEventRaw(_SyclEventRaw):
206207
207208 @staticmethod
208209 def wait (event ):
209- if isinstance (event, list ):
210+ """ Waits for a given event or a sequence of events.
211+ """
212+ if (isinstance (event, collections.abc.Sequence) and
213+ all ( (isinstance (el, SyclEventRaw) for el in event) )):
210214 for e in event:
211215 SyclEventRaw._wait(e)
212216 elif isinstance (event, SyclEventRaw):
213217 SyclEventRaw._wait(event)
214218 else :
215- raise ValueError (" The passed argument is not a list \
216- or a SyclEventRaw type." )
219+ raise TypeError (
220+ " The passed argument is not a SyclEventRaw type or "
221+ " a sequence of such objects"
222+ )
217223
218224 def addressof_ref (self ):
219225 """ Returns the address of the C API `DPCTLSyclEventRef` pointer as
You can’t perform that action at this time.
0 commit comments