summaryrefslogtreecommitdiffstats
path: root/SCons
diff options
context:
space:
mode:
authorAlex James <git@alextjam.es>2024-09-22 23:07:21 (GMT)
committerAlex James <git@alextjam.es>2024-09-23 17:40:49 (GMT)
commit2d5e3a40a613225b329776ab9dbd9abcd2d24222 (patch)
treeed4764fd14daa45aeefcc0e028cde969d7dc50dc /SCons
parent5404eb70cc02bd5697b0274e5632be41436737f8 (diff)
downloadSCons-2d5e3a40a613225b329776ab9dbd9abcd2d24222.zip
SCons-2d5e3a40a613225b329776ab9dbd9abcd2d24222.tar.gz
SCons-2d5e3a40a613225b329776ab9dbd9abcd2d24222.tar.bz2
Handle permission errors while generating paths on Darwin
On Darwin, Nix may invoke SCons in a sandbox which lacks access to /etc/paths.d. Handle PermissionError while iterating through /etc/paths.d to support sandboxed environments such as Nix.
Diffstat (limited to 'SCons')
-rw-r--r--SCons/Platform/darwin.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/SCons/Platform/darwin.py b/SCons/Platform/darwin.py
index 381b542..4ab7466 100644
--- a/SCons/Platform/darwin.py
+++ b/SCons/Platform/darwin.py
@@ -46,7 +46,7 @@ def generate(env) -> None:
# make sure this works on Macs with Tiger or earlier
try:
dirlist = os.listdir('/etc/paths.d')
- except FileNotFoundError:
+ except (FileNotFoundError, PermissionError):
dirlist = []
for file in dirlist: