Skip to content

Commit 69c0e62

Browse files
authored
Merge pull request #66 from dotlambda/patch-1
don't fail if there is no /etc/os-release
2 parents 7dab778 + 079691e commit 69c0e62

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commoncode/system.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ def is_on_ubuntu_22(os_release_location='/etc/os-release'):
9494
os_release_info = parse_os_release(os_release_location)
9595
return os_release_info['ID'] == 'ubuntu' and '22' in os_release_info['VERSION_ID']
9696

97-
98-
on_ubuntu_22 = is_on_ubuntu_22()
97+
try:
98+
on_ubuntu_22 = is_on_ubuntu_22()
99+
except FileNotFoundError:
100+
on_ubuntu_22 = False
99101

100102
del is_on_ubuntu_22
101103

0 commit comments

Comments
 (0)