Merge pull request #4487 from s0undt3ch/master

Logging done late enough might happen when capture already stopped.
This commit is contained in:
Daniel Hahler 2018-12-02 12:10:00 +01:00 committed by GitHub
commit ecc5c84c1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1 @@
During teardown of the python process, and on rare occasions, capture attributes can be ``None`` while trying to resume global capture.

View File

@ -117,7 +117,10 @@ class CaptureManager(object):
self._global_capturing = None
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):
cap = getattr(self, "_global_capturing", None)