py-cpuinfo icon indicating copy to clipboard operation
py-cpuinfo copied to clipboard

cpuinfo is forcing open console windows if imported into a non-console execution environment

Open EricBLivingston opened this issue 2 years ago • 0 comments

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)

EricBLivingston avatar Mar 02 '23 15:03 EricBLivingston