mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-31 03:50:45 -07:00
Fix output_grabber.py to allow several calls
This commit is contained in:
parent
bd3e8db852
commit
9d66c11ac4
2 changed files with 4 additions and 4 deletions
|
@ -17,8 +17,6 @@ class OutputGrabber(object):
|
|||
self.origstream = sys.stdout
|
||||
self.origstreamfd = self.origstream.fileno()
|
||||
self.capturedtext = ""
|
||||
# Create a pipe so the stream can be captured:
|
||||
self.pipe_out, self.pipe_in = os.pipe()
|
||||
|
||||
def __enter__(self):
|
||||
self.start()
|
||||
|
@ -32,6 +30,8 @@ class OutputGrabber(object):
|
|||
Start capturing the stream data.
|
||||
"""
|
||||
self.capturedtext = ""
|
||||
# Create a pipe so the stream can be captured:
|
||||
self.pipe_out, self.pipe_in = os.pipe()
|
||||
# Save a copy of the stream:
|
||||
self.streamfd = os.dup(self.origstreamfd)
|
||||
# Replace the original stream with our write pipe:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue