Skip to content

Commit 473b18c

Browse files
committed
Fix Rhino 5 platform.system() incorrectly set
1 parent 0b40fef commit 473b18c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ghpythonremote/helpers.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@
77

88
logger = logging.getLogger("ghpythonremote.helpers")
99

10+
11+
RUNNING_IN_RHINO5 = False
12+
try:
13+
from Rhino.RhinoApp import ExeVersion
14+
15+
if ExeVersion == 5:
16+
RUNNING_IN_RHINO5 = True
17+
except ImportError:
18+
pass
19+
1020
WINDOWS = False
1121
MACOS = False
12-
if platform.system() == "Windows":
22+
# "cli" is for IronPython in Rhino 5
23+
if platform.system() == "Windows" or (RUNNING_IN_RHINO5 and platform.system() == "cli"):
1324
WINDOWS = True
1425
if platform.system() == "Darwin":
1526
MACOS = True

0 commit comments

Comments
 (0)