From: David Jaša Date: Tue, 23 Aug 2022 21:58:09 +0000 (+0200) Subject: check-os-release.py compatible with Python < 3.8 X-Git-Tag: v252-rc1~359 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce0a056abc41168e1b45537505ca9f65bf6f5c30;p=thirdparty%2Fsystemd.git 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. --- diff --git a/man/check-os-release.py b/man/check-os-release.py index 91a5494b4a1..1a57c7a20d0 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)