diff options
author | David Jaša <jasa.david@gmail.com> | 2022-08-23 23:58:09 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-08-24 05:08:17 +0200 |
commit | ce0a056abc41168e1b45537505ca9f65bf6f5c30 (patch) | |
tree | 5eaea582b520a1d559974cd08ddf701ba7fb594a /man/check-os-release.py | |
parent | sleep: support acpi_btp and suspend system if enabled, skipping custom timer (diff) | |
download | systemd-ce0a056abc41168e1b45537505ca9f65bf6f5c30.tar.xz systemd-ce0a056abc41168e1b45537505ca9f65bf6f5c30.zip |
check-os-release.py compatible with Python < 3.8
The ":=" operator was only added in Python 3.8 so splitting the line with it into two makes check-os-release.py actually fulfill its claim of working with any python version.
Diffstat (limited to 'man/check-os-release.py')
-rw-r--r-- | man/check-os-release.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/man/check-os-release.py b/man/check-os-release.py index 91a5494b4a..1a57c7a20d 100644 --- a/man/check-os-release.py +++ b/man/check-os-release.py @@ -17,7 +17,8 @@ def read_os_release(): line = line.rstrip() if not line or line.startswith('#'): continue - if m := re.match(r'([A-Z][A-Z_0-9]+)=(.*)', line): + m = re.match(r'([A-Z][A-Z_0-9]+)=(.*)', line) + if m: name, val = m.groups() if val and val[0] in '"\'': val = ast.literal_eval(val) |