Skip to content

Commit 844d203

Browse files
committed
Communicate before waiting
When running via pipes in stdin, it's going to be waiting for the 'y' command to start processing. Otherwise this will just freeze.
1 parent 323d67c commit 844d203

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

X3GWriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode):
5757
command = self.gpx_command(machine, temp_cfg_name, temp_gcode.name, temp_x3g.name)
5858
try:
5959
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
60-
process.wait() #Wait until it's done converting.
6160
output = process.communicate(b"y")
61+
process.wait() #Wait until it's done converting.
6262
Logger.log("d", str(output))
6363
except EnvironmentError as e:
6464
Logger.log("e", "System call to X3G converter application failed: {error_msg}".format(error_msg=str(e)))

0 commit comments

Comments
 (0)