wlheadless: Ignore os.waitpid(-1, 0) error
There's a chance that all child processes have already stopped running
by the time we're cleaning up. If we then try to wait on child processes
to finish (using os.waitpid(-1, 0)
, the function will throw a
ChildProcessError
, which makes the whole script fail, with the
following error message:
Traceback (most recent call last):
File "/usr/bin/wlheadless-run", line 90, in <module>
wlheadless_common.cleanup()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/wlheadless/wlheadless_common.py", line 151, in cleanup
self.__cleanup_tempdir()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/wlheadless/wlheadless_common.py", line 136, in __cleanup_tempdir
os.waitpid(-1, 0)
~~~~~~~~~~^^^^^^^
ChildProcessError: [Errno 10] No child processes
Just ignore the error if it happens.