Skip to content

Commit

Permalink
Fix conda runtime on Windows (operating from within conda as well)
Browse files Browse the repository at this point in the history
  • Loading branch information
openvmp committed Jan 13, 2024
1 parent 3182232 commit 46178f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion partcad/src/partcad/runtime_python_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def run(self, cmd, stdin=""):
"--no-capture-output",
"-p",
self.path,
"python%s" % self.version,
"python", # Trust conda to set the link correctly
# "python%s" % self.version, # This doesn't work on Windows
]
+ cmd,
stdin,
Expand Down
9 changes: 5 additions & 4 deletions partcad/src/partcad/wrappers/wrapper_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# This script contains code shared by all wrapper scripts.

import base64
import fcntl

# import fcntl # TODO(clairbee): replace it with whatever works on Windows if needed
import os
import pickle
import sys
Expand All @@ -27,9 +28,9 @@ def handle_input():
# - Comand line parameters
path = sys.argv[1]
# - Content passed via stdin
# - Make stdin blocking so that we can read until EOF
flag = fcntl.fcntl(sys.stdin, fcntl.F_GETFL)
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, flag & ~os.O_NONBLOCK)
# # - Make stdin blocking so that we can read until EOF
# flag = fcntl.fcntl(sys.stdin, fcntl.F_GETFL)
# fcntl.fcntl(sys.stdin, fcntl.F_SETFL, flag & ~os.O_NONBLOCK)
# - Read until EOF
input_str = sys.stdin.read()
# - Unpack the content received via stdin
Expand Down

0 comments on commit 46178f2

Please sign in to comment.