[Fixed] The hide_stderr function when exception

- Needed a finally
This commit is contained in:
Salvador E. Tropea 2022-10-18 12:34:51 -03:00
parent f78f8b3064
commit ad2b4e48d1
1 changed files with 4 additions and 2 deletions

View File

@ -295,8 +295,10 @@ def hide_stderr():
devnull = os.open('/dev/null', os.O_WRONLY)
os.dup2(devnull, 2)
os.close(devnull)
yield
os.dup2(newstderr, 2)
try:
yield
finally:
os.dup2(newstderr, 2)
def version_str2tuple(ver):