File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1586,6 +1586,7 @@ def stop(self):
1586
1586
Note that if you don't call this before your application exits, there
1587
1587
may be some records still left on the queue, which won't be processed.
1588
1588
"""
1589
- self .enqueue_sentinel ()
1590
- self ._thread .join ()
1591
- self ._thread = None
1589
+ if self ._thread : # see gh-114706 - allow calling this more than once
1590
+ self .enqueue_sentinel ()
1591
+ self ._thread .join ()
1592
+ self ._thread = None
Original file line number Diff line number Diff line change @@ -4089,6 +4089,7 @@ def test_queue_listener(self):
4089
4089
self .que_logger .critical (self .next_message ())
4090
4090
finally :
4091
4091
listener .stop ()
4092
+ listener .stop () # gh-114706 - ensure no crash if called again
4092
4093
self .assertTrue (handler .matches (levelno = logging .WARNING , message = '1' ))
4093
4094
self .assertTrue (handler .matches (levelno = logging .ERROR , message = '2' ))
4094
4095
self .assertTrue (handler .matches (levelno = logging .CRITICAL , message = '3' ))
You can’t perform that action at this time.
0 commit comments