capture: fix FDCapture.__repr__ without targetfd_save

This commit is contained in:
Daniel Hahler
2019-03-18 02:06:52 +01:00
parent c926999cfb
commit 98981276a0
2 changed files with 12 additions and 2 deletions

View File

@@ -539,7 +539,10 @@ class FDCaptureBinary(object):
self.tmpfile_fd = tmpfile.fileno()
def __repr__(self):
return "<FDCapture %s oldfd=%s>" % (self.targetfd, self.targetfd_save)
return "<FDCapture %s oldfd=%s>" % (
self.targetfd,
getattr(self, "targetfd_save", None),
)
def start(self):
""" Start capturing on targetfd using memorized tmpfile. """