py-cpuinfo
py-cpuinfo copied to clipboard
cpuinfo is forcing open console windows if imported into a non-console execution environment
Basically, you need to change the following:
def _run_and_get_stdout(command, pipe_command=None):
from subprocess import Popen, PIPE
g_trace.command_header('Running command "' + ' '.join(command) + '" ...')
# Run the command normally
if not pipe_command:
p1 = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE)
The Popen command should be: p1 = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE, creationflags=subprocess.CREATE_NO_WINDOW)