Skip to content

Commit

Permalink
fix issue camelot-dev#43: close_fds incompatibility on windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Mazoyer committed Feb 11, 2019
1 parent bae34cf commit f5f6de1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion excalibur/executors/celery_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import traceback
import subprocess
import sys

from celery import Celery

Expand All @@ -28,7 +29,7 @@
@app.task
def execute_command(command):
try:
subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=True)
subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=(sys.platform != 'win32'))
except Exception as e:
traceback.print_exc()

Expand Down
3 changes: 2 additions & 1 deletion excalibur/executors/sequential_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import traceback
import subprocess
from concurrent.futures import ProcessPoolExecutor
import sys

from .base_executor import BaseExecutor


def execute_command(command):
try:
subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=True)
subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=(sys.platform != 'win32'))
except FileNotFoundError:
# TODO: PyInstaller does not package console_scripts
# https://github.com/pyinstaller/pyinstaller/issues/305
Expand Down

0 comments on commit f5f6de1

Please sign in to comment.