Logging done late enough might happen when capture already stopped.

This commit is contained in:
Pedro Algarvio 2018-11-30 23:04:59 +00:00
parent d8e00c983e
commit f4d3ec6370
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF
1 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,10 @@ class CaptureManager(object):
self._global_capturing = None self._global_capturing = None
def resume_global_capture(self): def resume_global_capture(self):
self._global_capturing.resume_capturing() # During teardown of the python process, and on rare occasions, capture
# attributes can be `None` while trying to resume global capture.
if self._global_capturing is not None:
self._global_capturing.resume_capturing()
def suspend_global_capture(self, in_=False): def suspend_global_capture(self, in_=False):
cap = getattr(self, "_global_capturing", None) cap = getattr(self, "_global_capturing", None)