Skip to content

Commit

Permalink
Fix sys not windows arg problem
Browse files Browse the repository at this point in the history
  • Loading branch information
JE-Chen committed Sep 27, 2023
1 parent cab8f9f commit c8be528
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
21 changes: 14 additions & 7 deletions automation_editor/extend/process_executor/task_process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ def renew_path(self) -> None:

def start_test_process(self, package: str, exec_str: str):
self.renew_path()
args = [
self.compiler_path,
"-m",
package,
"--execute_str",
exec_str
]
if sys.platform not in ["win32", "cygwin", "msys"]:
args = " ".join(args)
self.process: subprocess.Popen = subprocess.Popen(
[
self.compiler_path,
"-m",
package,
"--execute_str",
exec_str
],
args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True
Expand Down Expand Up @@ -142,12 +145,16 @@ def read_program_output_from_process(self):
while self.still_run_program:
self.process: subprocess.Popen
program_output_data = self.process.stdout.read(self.program_buffer_size).decode(self.program_encoding)
if self.process:
self.process.stdout.flush()
if program_output_data.strip() != "":
self.run_output_queue.put(program_output_data)

def read_program_error_output_from_process(self):
while self.still_run_program:
program_error_output_data = self.process.stderr.read(self.program_buffer_size).decode(
self.program_encoding)
if self.process:
self.process.stderr.flush()
if program_error_output_data.strip() != "":
self.run_error_queue.put(program_error_output_data)
8 changes: 4 additions & 4 deletions stable.toml → dev.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to build stable version
# This is stable version
# Rename to dev version
# This is dev version
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_editor"
version = "0.0.32"
name = "automation_editor_dev"
version = "0.0.33"
authors = [
{ name = "JE-Chen", email = "[email protected]" },
]
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to dev version
# This is dev version
# Rename to build stable version
# This is stable version
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_editor_dev"
version = "0.0.32"
name = "automation_editor"
version = "0.0.33"
authors = [
{ name = "JE-Chen", email = "[email protected]" },
]
Expand Down

0 comments on commit c8be528

Please sign in to comment.