Skip to content

Commit

Permalink
Communicate before waiting
Browse files Browse the repository at this point in the history
When running via pipes in stdin, it's going to be waiting for the 'y' command to start processing. Otherwise this will just freeze.
  • Loading branch information
Ghostkeeper committed Nov 12, 2018
1 parent 323d67c commit 844d203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion X3GWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode):
command = self.gpx_command(machine, temp_cfg_name, temp_gcode.name, temp_x3g.name)
try:
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process.wait() #Wait until it's done converting.
output = process.communicate(b"y")
process.wait() #Wait until it's done converting.
Logger.log("d", str(output))
except EnvironmentError as e:
Logger.log("e", "System call to X3G converter application failed: {error_msg}".format(error_msg=str(e)))
Expand Down

0 comments on commit 844d203

Please sign in to comment.