diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-12-04 18:39:53 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-04 20:02:57 +0100 |
commit | 62887aa764e51a74d3b452abd2297a05d9a6bd3f (patch) | |
tree | eedb3390960001713083acce50591aed0007e85f | |
parent | dad6155e2882e27b972845d458087d8ecbf5be43 (diff) |
Fix ResourceWarning in pythonloader.py
trace:
/home/julien/lo/libreoffice/instdir/program/pythonloader.py:146: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/julien/lo/libreoffice/instdir/share/extensions/numbertext/reg.uno.py' mode='r' encoding='utf_8'>
mod = self.getModuleFromUrl( locationUrl )
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Change-Id: I106ab6c3c9024a8c1a4624a3b64958dc205e30e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107232
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | pyuno/source/loader/pythonloader.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pyuno/source/loader/pythonloader.py b/pyuno/source/loader/pythonloader.py index 5b824a3c26a1..7c16e226bad9 100644 --- a/pyuno/source/loader/pythonloader.py +++ b/pyuno/source/loader/pythonloader.py @@ -100,6 +100,7 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ): mod.__file__ = filename exec(codeobject, mod.__dict__) g_loadedComponents[url] = mod + fileHandle.close() return mod elif "vnd.openoffice.pymodule" == protocol: nSlash = dependent.rfind('/') |