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 <stephan.bergmann@allotropia.de>
diff --git a/solenv/qa/python/gbuildtojson.py b/solenv/qa/python/gbuildtojson.py
index a6ba733..d8434ac 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: