diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-09-17 10:55:26 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-17 13:10:29 +0200 |
commit | 0bd92e6314b799afec447c1e30260d9a8dfad894 (patch) | |
tree | a1c5bc59df554944480cc1a1e5f363793de5b0d0 /bin | |
parent | Tokens2RangeStringXML ctor never called with null ScDocument* (diff) | |
download | core-0bd92e6314b799afec447c1e30260d9a8dfad894.tar.gz core-0bd92e6314b799afec447c1e30260d9a8dfad894.zip |
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@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gbuild-to-ide | 4 |
1 files changed, 2 insertions, 2 deletions
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' |