Skip to content

Commit b5eea71

Browse files
miss-islingtonneek78blurb-it[bot]
authored
[3.15] gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854) (#151506)
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854) /run/ on my FreeBSD install is not readable causing failing test. (cherry picked from commit 35ce2e5) Co-authored-by: Nick Begg <nick@stunttruck.net> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent cc91b26 commit b5eea71

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3164,7 +3164,7 @@ def in_systemd_nspawn_sync_suppressed() -> bool:
31643164
with open("/run/systemd/container", "rb") as fp:
31653165
if fp.read().rstrip() != b"systemd-nspawn":
31663166
return False
3167-
except FileNotFoundError:
3167+
except (FileNotFoundError, PermissionError):
31683168
return False
31693169

31703170
# If systemd-nspawn is used, O_SYNC flag will immediately
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix tests failing on FreeBSD in test.support's
2+
in_systemd_nspawn_sync_suppressed() due to unreadable /run directory.

0 commit comments

Comments
 (0)