Fixed the way we restore stderr after temporarily supressing it.
Now we don't mess with `sys.stderr` we just use `os.dup2` to restore it from the copy.
This commit is contained in:
parent
67cee9988a
commit
12bfa88677
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
|
|
@ -210,4 +209,4 @@ def hide_stderr():
|
|||
os.dup2(devnull, 2)
|
||||
os.close(devnull)
|
||||
yield
|
||||
sys.stderr = os.fdopen(newstderr, 'w')
|
||||
os.dup2(newstderr, 2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue