File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -327,8 +327,11 @@ def wait(self):
327
327
if self .timeout is None and len (self ._signals ) == 0 :
328
328
raise ValueError ("No signals or timeout specified." )
329
329
if self .timeout is not None :
330
- QtCore .QTimer .singleShot (self .timeout , self ._quit_loop_by_timeout )
330
+ QtCore .QTimer .singleShot (self .timeout , self ._loop . quit )
331
331
self ._loop .exec_ ()
332
+ if not self .signal_triggered and self .raising :
333
+ raise QtBot .SignalTimeout ("Didn't get signal after %sms." %
334
+ self .timeout )
332
335
333
336
def connect (self , signal ):
334
337
"""
@@ -347,17 +350,6 @@ def _quit_loop_by_signal(self):
347
350
self .signal_triggered = True
348
351
self ._loop .quit ()
349
352
350
- def _quit_loop_by_timeout (self ):
351
- """
352
- quits the event loop and marks that we finished because of a timeout.
353
- """
354
- assert not self .signal_triggered
355
- self ._loop .quit ()
356
- if self .raising :
357
- raise QtBot .SignalTimeout ("Didn't get signal after %sms." %
358
- self .timeout )
359
-
360
-
361
353
def __enter__ (self ):
362
354
return self
363
355
You can’t perform that action at this time.
0 commit comments