summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-02-25 10:46:10 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2021-02-26 08:54:56 +0100
commit5d5ada6e0ed33d22f8b744621d2d151c31ae0033 (patch)
tree867821b22f2e2891a2c49754295f0abc2f604a2c /bin
parent3e88599efb38e3b9f7b4d18d62627b5ecffa0bf3 (diff)
qtcreator: Move assignment to 'mode' out of try block
The variable is used outside of the try block further down. While that works with how Python handles variable scopes (and there is no exception before the assignment happens), moving the variable outside makes the context/scope clearer. Change-Id: Iecfd0477ffb4515cf58736ee138fc8ca7273967f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111548 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gbuild-to-ide2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 10d9b2bcc47a..ac3115aa3d25 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1754,6 +1754,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
def emit(self):
+ mode = 'w+'
self.base_folder = self.gbuildparser.builddir
# we remove existing '.pro' and '.pro.shared' files
@@ -1785,7 +1786,6 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
try:
content = QtCreatorIntegrationGenerator.pro_template % {'sources': sources, 'headers': headers,
'cxxflags': cxxflags, 'includepath': includepath, 'defines': defines}
- mode = 'w+'
with open(qt_pro_file, mode) as fpro:
fpro.write(content)
self._log("created %s\n" % qt_pro_file)