Skip to content

Commit 35ce2e5

Browse files
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (#148854)
/run/ on my FreeBSD install is not readable causing failing test. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent b6a2eef commit 35ce2e5

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
@@ -3159,7 +3159,7 @@ def in_systemd_nspawn_sync_suppressed() -> bool:
31593159
with open("/run/systemd/container", "rb") as fp:
31603160
if fp.read().rstrip() != b"systemd-nspawn":
31613161
return False
3162-
except FileNotFoundError:
3162+
except (FileNotFoundError, PermissionError):
31633163
return False
31643164

31653165
# 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)