mirror of
https://github.com/smyalygames/FiniteVolumeGPU.git
synced 2025-05-18 14:34:13 +02:00
Refactoring.
This commit is contained in:
parent
6a1f58c8df
commit
239c1fdcd9
@ -50,19 +50,14 @@ def safeCall(cmd):
|
|||||||
try:
|
try:
|
||||||
#git rev-parse HEAD
|
#git rev-parse HEAD
|
||||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
params = dict()
|
||||||
|
params['stderr'] = subprocess.STDOUT
|
||||||
|
params['cwd'] = current_dir
|
||||||
|
params['universal_newlines'] = True #text=True in more recent python
|
||||||
|
params['shell'] = False
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
stdout = subprocess.check_output(cmd,
|
params['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
|
||||||
stderr=subprocess.STDOUT,
|
stdout = subprocess.check_output(cmd, **params)
|
||||||
cwd=current_dir,
|
|
||||||
universal_newlines=True, #text=True in more recent python
|
|
||||||
shell=False,
|
|
||||||
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
|
|
||||||
else:
|
|
||||||
stdout = subprocess.check_output(cmd,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
cwd=current_dir,
|
|
||||||
universal_newlines=True, #text=True in more recent python
|
|
||||||
shell=False)
|
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
output = e.output
|
output = e.output
|
||||||
logger.error("Git failed, \nReturn code: " + str(e.returncode) + "\nOutput: " + output)
|
logger.error("Git failed, \nReturn code: " + str(e.returncode) + "\nOutput: " + output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user