Skip to content

Commit 2cf294a

Browse files
committed
solve NameError bug on mac
1 parent a333542 commit 2cf294a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Moved import of `subprocess` to top of file `compas._os.py`.
15+
1416
### Removed
1517

1618

src/compas/_os.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import shutil
88
import sys
99
import tempfile
10+
import subprocess
1011

1112
try:
1213
NotADirectoryError
@@ -113,7 +114,6 @@ def is_blender():
113114

114115

115116
if is_windows():
116-
import subprocess
117117
import ctypes
118118
import ctypes.wintypes
119119

@@ -146,6 +146,9 @@ def __init__(self, **kw):
146146
INFINITE = -1
147147

148148

149+
# seems a bit weird that this is done here, since it is only relevant for Rhino/GH
150+
# also, perhasps it makes more sense this is done at the top of the file
151+
# since it defines a few module-wide variables
149152
try:
150153
from compas_bootstrapper import PYTHON_DIRECTORY
151154
except: # noqa: E722

src/compas_rhino/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _get_ironpython_lib_path(version):
7878
# However, since it is only used to clean up potential old installations
7979
# it does not seem crucial anymore.
8080
ironpython_lib_path = None
81-
print("The lib folder for IronPython does not exist in this location: {}".format(ironpython_lib_path))
81+
# print("The lib folder for IronPython does not exist in this location: {}".format(ironpython_lib_path))
8282

8383
return ironpython_lib_path
8484

0 commit comments

Comments
 (0)