commit 58ded8a0ddd99c8ef38a578a780b5ef5c7f14c38 Author: Lokendra Singh Date: Mon Aug 26 10:47:44 2019 +0530 Apply suggestions from code review Co-Authored-By: Sushain Cherivirala diff --git a/apertium/utils.py b/apertium/utils.py index be41287..b4c8a46 100644 --- a/apertium/utils.py +++ b/apertium/utils.py @@ -113,6 +113,7 @@ def execute_pipeline(inp: str, commands: List[List[str]]) -> str: output = deformatter(end.decode()) end = output.encode() continue + input_file = tempfile.NamedTemporaryFile(delete=False, mode='w') output_file = tempfile.NamedTemporaryFile(delete=False) @@ -157,6 +158,7 @@ def execute_pipeline(inp: str, commands: List[List[str]]) -> str: os.remove(input_file.name) os.remove(output_file.name) + if not wrappers_available or not used_wrapper: apertium.logger.warning('Calling subprocess %s', command[0]) proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)