From: Zbigniew Jędrzejewski-Szmek Date: Thu, 19 Feb 2026 12:01:01 +0000 (+0100) Subject: generate-sym-test: skip everything that is not a file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=469879aa44c4cde5541b98be0a4421ab069c5834;p=thirdparty%2Fsystemd.git generate-sym-test: skip everything that is not a file The generator looks for files in the filesystem, and it sometimes fails on emacs "lock files" which are a symlink. Ignore those. --- diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py index 8fcf1752893..b8d64d623f0 100755 --- a/src/test/generate-sym-test.py +++ b/src/test/generate-sym-test.py @@ -6,6 +6,7 @@ import os import re import sys +from pathlib import Path from typing import IO @@ -161,7 +162,10 @@ for dirpath, _, filenames in sorted(os.walk(sys.argv[2])): for filename in sorted(filenames): if not filename.endswith('.c') and not filename.endswith('.h'): continue - with open(os.path.join(dirpath, filename), 'r') as f: + p = Path(dirpath) / filename + if p.is_symlink(): + continue + with p.open('rt') as f: process_source_file(f) print(""" {}