From ce0a056abc41168e1b45537505ca9f65bf6f5c30 Mon Sep 17 00:00:00 2001 From: David Jaša Date: Tue, 23 Aug 2022 23:58:09 +0200 Subject: 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. --- man/check-os-release.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'man/check-os-release.py') 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) -- cgit v1.2.3