Skip to content

Commit

Permalink
Update scons command with new run rather tha deprecated call subprocess.
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed May 13, 2024
1 parent 245f850 commit fc57e79
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/openalea/deploy/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from distutils.errors import *
import stat
import glob
import shlex

from os.path import join as pj
from setuptools import Command
from setuptools.dist import assert_string_list, assert_bool
Expand Down Expand Up @@ -412,11 +414,9 @@ def run(self):
return

# try to import subprocess package
try:
import subprocess
subprocess_enabled = True
except ImportError:
subprocess_enabled = False
import subprocess
subprocess_enabled = True


# run each scons script from setup.py
for s in self.scons_scripts:
Expand Down Expand Up @@ -453,10 +453,11 @@ def run(self):
print(commandstr)

# Run SCons
if (subprocess_enabled):
retval = subprocess.call(commandstr, shell=True)
else:
retval = os.system(commandstr)
# Fix issue 57 : Martin and Christophe

command_line = shlex.split(commandstr)
result = subprocess.run(command_line, shell=True, timeout=None)
retval = result.returncode

# Test if command success with return value
if (retval != 0):
Expand Down

0 comments on commit fc57e79

Please sign in to comment.