Skip to content

Commit

Permalink
don't fail if there is no /etc/os-release
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Schütz <[email protected]>
  • Loading branch information
dotlambda committed Jul 24, 2024
1 parent b118354 commit 4f87b3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commoncode/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def is_on_ubuntu_22(os_release_location='/etc/os-release'):
os_release_info = parse_os_release(os_release_location)
return os_release_info['ID'] == 'ubuntu' and '22' in os_release_info['VERSION_ID']

on_ubuntu_22 = is_on_ubuntu_22()
try:
on_ubuntu_22 = is_on_ubuntu_22()
except FileNotFoundError:
on_ubuntu_22 = False

del is_on_ubuntu_22

Expand Down

0 comments on commit 4f87b3c

Please sign in to comment.