summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-06-23 11:45:50 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-23 21:02:15 +0200
commit87d25bdead80fa924c5307438c247a992690cbd6 (patch)
tree25cc23ee6dc583627bc5d01ee5336d09cff0deb8
parent21385e639acfaed4aa5fb810b12d43e3c8696925 (diff)
downloadsystemd-87d25bdead80fa924c5307438c247a992690cbd6.tar.gz
make-autosuspend-rules: restore compatibility with Python3 < 3.6
The f'...' format was introduced in Python 3.6 ( https://www.python.org/dev/peps/pep-0498/ ) and returns an error when systemd is built on a system with an older Python3 version: <...> File /home/bluca/git/systemd/tools/make-autosuspend-rules.py, line 15 print(f'pci:v{vendor:08X}d{device:08X}*') ^ SyntaxError: invalid syntax [2/388] Generating version.h with a custom command. ninja: build stopped: subcommand failed. $ python3 --version Python 3.5.6 Use an older format to keep backward compatibility.
-rwxr-xr-xtools/make-autosuspend-rules.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/make-autosuspend-rules.py b/tools/make-autosuspend-rules.py
index 065752ced4..e13ca33f6f 100755
--- a/tools/make-autosuspend-rules.py
+++ b/tools/make-autosuspend-rules.py
@@ -12,13 +12,13 @@ for entry in chromiumos.gen_autosuspend_rules.PCI_IDS:
vendor, device = entry.split(':')
vendor = int(vendor, 16)
device = int(device, 16)
- print(f'pci:v{vendor:08X}d{device:08X}*')
+ print('pci:v{:08X}d{:08X}*'.format(vendor, device))
print('# usb:v<VEND>p<PROD> (4 uppercase hexadecimal digits twice')
for entry in chromiumos.gen_autosuspend_rules.USB_IDS:
vendor, product = entry.split(':')
vendor = int(vendor, 16)
product = int(product, 16)
- print(f'usb:v{vendor:04X}p{product:04X}*')
+ print('usb:v{:04X}p{:04X}*'.format(vendor, product))
print(' ID_AUTOSUSPEND=1')