Skip to content

Commit a71f3d1

Browse files
committed
Handle case in _configure_openmp() where MacOS system doesn't have Homebrew
On a MacOS system that's not using Homebrew, running `brew --prefix llvm` with `subprocess.check_output` doesn't produce a CalledProcessError; instead, when the shell produces a FileNotFoundError it passes it back and `check_output` raises that instead. If we check for OSError (the parent of FileNotFoundError, which should handle other OS-related errors that could get passed back) as well, then this should correctly handle this case. The MacPorts check doesn't have the same issue, because the `which` command is built in and so `which port` will raise a CalledProcessError if MacPorts isn't installed.
1 parent f2a2c21 commit a71f3d1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Fixed some typos (thanks to @eltociear, @Darkdragon84)
1717
- Fixed support for Python 3.12
18+
- Fixed check for OpenMP so it works on MacOS systems without Homebrew
1819

1920
### Removed
2021

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def _configure_openmp(self):
505505
self.opts.append(flag)
506506
self.link_opts.extend((l_arg, flag))
507507
return
508-
except subprocess.CalledProcessError:
508+
except (subprocess.CalledProcessError, OSError):
509509
pass
510510

511511
try:

0 commit comments

Comments
 (0)