Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a6960a78 authored by IMBERT Matthieu's avatar IMBERT Matthieu
Browse files

[execo_engine] utils: fix py3 issue for redirect_outputs and copy_outputs

parent af00faa9
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ def redirect_outputs(stdout_filename, stderr_filename): ...@@ -76,7 +76,7 @@ def redirect_outputs(stdout_filename, stderr_filename):
# additionnaly force stdout unbuffered by reopening stdout # additionnaly force stdout unbuffered by reopening stdout
# file descriptor with write mode # file descriptor with write mode
# and 0 as the buffer size (unbuffered) # and 0 as the buffer size (unbuffered)
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1 if sys.version_info >= (3,) else 0)
def copy_outputs(stdout_filename, stderr_filename): def copy_outputs(stdout_filename, stderr_filename):
"""Copy, and optionnaly merge, stdout and stderr to file(s)""" """Copy, and optionnaly merge, stdout and stderr to file(s)"""
...@@ -87,7 +87,7 @@ def copy_outputs(stdout_filename, stderr_filename): ...@@ -87,7 +87,7 @@ def copy_outputs(stdout_filename, stderr_filename):
# additionnaly force stdout unbuffered by reopening stdout # additionnaly force stdout unbuffered by reopening stdout
# file descriptor with write mode # file descriptor with write mode
# and 0 as the buffer size (unbuffered) # and 0 as the buffer size (unbuffered)
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1 if sys.version_info >= (3,) else 0)
def slugify(value): def slugify(value):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment