[Bugfix] Make suppress_stdout redirect fd 1 instead of sys.stdout.fileno() (#59336)
Signed-off-by: usmanmateen <usmanmateen255@gmail.com> Co-authored-by: Misha Goin <mgoin64@gmail.com>
This commit is contained in:
co-authored by
Misha Goin
parent
dfaabf91ac
commit
e73895a5df
@@ -72,7 +72,8 @@ def suppress_stdout():
|
||||
yield
|
||||
return
|
||||
|
||||
stdout_fd = sys.stdout.fileno()
|
||||
# C libraries write to fd 1, whatever sys.stdout is bound to.
|
||||
stdout_fd = 1
|
||||
stdout_dup = os.dup(stdout_fd)
|
||||
devnull_fd = os.open(os.devnull, os.O_WRONLY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user