]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use lstat() instead of stat(follow_symlinks=False)
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Jan 2024 13:28:20 +0000 (14:28 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 26 Jan 2024 21:13:28 +0000 (21:13 +0000)
This makes the test compatible with Python 3.9, as the follow_symlinks
keyword was introduced in Python 3.10.

test/test-udev.py

index 5a95b9c521315fd9aa05a1137cee0326d5ed659c..d9d840eb8ce663864ea2c76135be63f931c423cf 100755 (executable)
@@ -122,7 +122,7 @@ class Device:
         print(f'check_add {self.devpath}')
 
         devnode = self.get_devnode()
-        st = devnode.stat(follow_symlinks=False)
+        st = devnode.lstat()
         assert stat.S_ISCHR(st.st_mode) or stat.S_ISBLK(st.st_mode)
         self.check_permissions(st)
         self.check_major_minor(st)