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
25
25
26
26
from cpython cimport pycapsule
27
27
from libc.stdint cimport uint64_t
28
+ import collections.abc
28
29
29
30
from ._backend cimport ( # noqa: E211
30
31
DPCTLEvent_Copy,
@@ -206,14 +207,19 @@ cdef class SyclEventRaw(_SyclEventRaw):
206
207
207
208
@staticmethod
208
209
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) )):
210
214
for e in event:
211
215
SyclEventRaw._wait(e)
212
216
elif isinstance (event, SyclEventRaw):
213
217
SyclEventRaw._wait(event)
214
218
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
+ )
217
223
218
224
def addressof_ref (self ):
219
225
""" Returns the address of the C API `DPCTLSyclEventRef` pointer as
You can’t perform that action at this time.
0 commit comments