solenv/qa/python/gbuildtojson.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 0020fc1167b3760d0631001689a44427b72b816e Author: Stephan Bergmann <[email protected]> AuthorDate: Tue Mar 19 15:03:37 2024 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Wed Mar 20 08:07:29 2024 +0100 Fix PythonTest_solenv_python for Linux --enable-mergelibs=more ...where it recently started to fail for me with > ====================================================================== > ERROR: test_gbuildtojson (gbuildtojson.CheckGbuildToJsonModules) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "solenv/qa/python/gbuildtojson.py", line 147, in test_gbuildtojson > jsonfiles = os.listdir(os.path.join(self.tempwork, 'GbuildToJson', 'Library')) > FileNotFoundError: [Errno 2] No such file or directory: '/tmp/gbuildffqxqxbf/GbuildToJson/Library' presumably because none of the modules iterated over there happen to put any files into the GbuildToJson/Library directory (and, by doing so, would create that directory) Change-Id: I2622f300d6d9c45d28a98fb6bb82aa684d1d5507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165033 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/solenv/qa/python/gbuildtojson.py b/solenv/qa/python/gbuildtojson.py index a6ba733d06b6..d8434acc5216 100644 --- a/solenv/qa/python/gbuildtojson.py +++ b/solenv/qa/python/gbuildtojson.py @@ -144,7 +144,10 @@ class CheckGbuildToJsonModules(unittest.TestCase): bashscript.close() subprocess.check_call([self.bash, bashscriptname.replace('\', '/')]) os.remove(bashscriptname) - jsonfiles = os.listdir(os.path.join(self.tempwork, 'GbuildToJson', 'Library')) + try: + jsonfiles = os.listdir(os.path.join(self.tempwork, 'GbuildToJson', 'Library')) + except FileNotFoundError: + jsonfiles = [] gbuildlibs = [] for jsonfilename in jsonfiles: with open(os.path.join(self.tempwork, 'GbuildToJson', 'Library', jsonfilename), 'r') as f:
