Skip to content

Commit 6602583

Browse files
committed
Don't build thread_utilization on windows
1 parent a9e8d17 commit 6602583

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
raise RuntimeError(error_msg)
5151

5252
with_setuptools = False
53+
is_windows = sys.platform == "win32"
5354

5455
try:
5556
from setuptools import setup
@@ -89,7 +90,7 @@ def newrelic_agent_next_version(version):
8990
with readme_file.open() as f:
9091
readme_file_contents = f.read()
9192

92-
if sys.platform == "win32" and python_version > (2, 6):
93+
if is_windows:
9394
build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError)
9495
else:
9596
build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
@@ -201,8 +202,13 @@ def _run_setup():
201202
if with_extensions:
202203
kwargs_tmp["ext_modules"] = [
203204
Extension("newrelic.packages.wrapt._wrappers", ["newrelic/packages/wrapt/_wrappers.c"]),
204-
Extension("newrelic.core._thread_utilization", ["newrelic/core/_thread_utilization.c"]),
205205
]
206+
if not is_windows:
207+
# This extension is only supported on POSIX platforms.
208+
kwargs_tmp["ext_modules"].append(
209+
Extension("newrelic.core._thread_utilization", ["newrelic/core/_thread_utilization.c"])
210+
)
211+
206212
kwargs_tmp["cmdclass"] = dict(build_ext=optional_build_ext)
207213

208214
setup(**kwargs_tmp)

0 commit comments

Comments
 (0)