jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1155379?usp=email )

Change subject: IMPR: Don't appending to dictionary immediately following its 
definition
......................................................................

IMPR: Don't appending to dictionary immediately following its definition

Change-Id: I754e1185382a75fcff0608fe4ed0419efa081837
---
M pywikibot/userinterfaces/gui.py
1 file changed, 10 insertions(+), 14 deletions(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Looks good to me, approved




diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py
index e560c72..acee922 100644
--- a/pywikibot/userinterfaces/gui.py
+++ b/pywikibot/userinterfaces/gui.py
@@ -13,7 +13,7 @@
 .. seealso:: :mod:`editor`
 """
 #
-# (C) Pywikibot team, 2003-2024
+# (C) Pywikibot team, 2003-2025
 #
 # Distributed under the terms of the MIT license.
 #
@@ -84,26 +84,22 @@
     @staticmethod
     def _initialize_config(theme):
         """Fix idleConf.GetHighlight method for different Python releases."""
-        config = {
+        return {
             'padx': 5,
             'wrap': 'word',
             'undo': 'True',
             'width': idleConf.GetOption('main', 'EditorWindow', 'width'),
             'height': idleConf.GetOption('main', 'EditorWindow', 'height'),
+            'foreground': idleConf.GetHighlight(theme, 'normal')['foreground'],
+            'background': idleConf.GetHighlight(theme, 'normal')['background'],
+            'highlightcolor': idleConf.GetHighlight(
+                theme, 'hilite')['foreground'],
+            'highlightbackground': idleConf.GetHighlight(
+                theme, 'hilite')['background'],
+            'insertbackground': idleConf.GetHighlight(
+                theme, 'cursor')['foreground'],
         }

-        config['foreground'] = idleConf.GetHighlight(
-            theme, 'normal')['foreground']
-        config['background'] = idleConf.GetHighlight(
-            theme, 'normal')['background']
-        config['highlightcolor'] = idleConf.GetHighlight(
-            theme, 'hilite')['foreground']
-        config['highlightbackground'] = idleConf.GetHighlight(
-            theme, 'hilite')['background']
-        config['insertbackground'] = idleConf.GetHighlight(
-            theme, 'cursor')['foreground']
-        return config
-
     def add_bindings(self) -> None:
         """Assign key and events bindings to methods."""
         # due to IDLE dependencies, this can't be called from __init__

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1155379?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I754e1185382a75fcff0608fe4ed0419efa081837
Gerrit-Change-Number: 1155379
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to