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

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 26 07:55:39 UTC 2021


 bin/gbuild-to-ide |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5d5ada6e0ed33d22f8b744621d2d151c31ae0033
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Thu Feb 25 10:46:10 2021 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri Feb 26 08:54:56 2021 +0100

    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 at posteo.de>

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)


More information about the Libreoffice-commits mailing list