mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
Merge pull request #1329 from Nihlus/fix-stdout-caching
Cache sys.stdout instead of assuming it is equal to sys.__stdout__
This commit is contained in:
@@ -213,11 +213,13 @@ def setup_logging():
|
||||
|
||||
@contextlib_contextmanager
|
||||
def redirect_stdout(stream):
|
||||
old_stdout = sys.stdout
|
||||
|
||||
sys.stdout = stream
|
||||
try:
|
||||
yield stream
|
||||
finally:
|
||||
sys.stdout = sys.__stdout__
|
||||
sys.stdout = old_stdout
|
||||
|
||||
|
||||
class AnsibleModuleLog():
|
||||
|
||||
@@ -241,11 +241,13 @@ def setup_logging():
|
||||
|
||||
@contextlib_contextmanager
|
||||
def redirect_stdout(stream):
|
||||
old_stdout = sys.stdout
|
||||
|
||||
sys.stdout = stream
|
||||
try:
|
||||
yield stream
|
||||
finally:
|
||||
sys.stdout = sys.__stdout__
|
||||
sys.stdout = old_stdout
|
||||
|
||||
|
||||
class AnsibleModuleLog():
|
||||
|
||||
Reference in New Issue
Block a user