[Libreoffice-commits] core.git: bin/gbuild-to-ide

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 17 11:11:13 UTC 2020


 bin/gbuild-to-ide |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0bd92e6314b799afec447c1e30260d9a8dfad894
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Sep 17 10:55:26 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Sep 17 13:10:29 2020 +0200

    make vim-ide-integration: fix ResourceWarning
    
    Exception ignored in: <_io.FileIO name='compile_commands.json' mode='wb' closefd=True>
    ResourceWarning: unclosed file <_io.TextIOWrapper name='compile_commands.json' mode='w' encoding='UTF-8'>
    
    Change-Id: I2ab4275a9b7897f5cd9e88b20a1eea4c68fe0d1f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102907
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7a6964abd454..bba9a9896b8a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -548,8 +548,8 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
                 entry = {'directory': lib.location, 'file': filePath, 'command': self.generateCommand(lib, filePath)}
                 entries.append(entry)
             global_list.extend(entries)
-        export_file = open('compile_commands.json', 'w')
-        json.dump(global_list, export_file)
+        with open('compile_commands.json', 'w') as export_file:
+            json.dump(global_list, export_file)
 
     def generateCommand(self, lib, file):
         command = 'clang++ -Wall'


More information about the Libreoffice-commits mailing list