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

Change subject: [IMPR] Add return after super(UI).encounter_color() call
......................................................................

[IMPR] Add return after super(UI).encounter_color() call

If none of stdin, stdout, or stderr is used, Win32UI.encounter_color()
calls the base class implementation. This is not critical because the
base class only raises NotImplementedError. However, returning after
this call is safer, since the base implementation might change in the
future and 'addr' would not be defined in such a case, leading to a
NameError.

Change-Id: I06007e07acfe2a64c564eaa553e4e897cbcf770d
---
M pywikibot/userinterfaces/terminal_interface_win32.py
1 file changed, 2 insertions(+), 1 deletion(-)

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




diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py 
b/pywikibot/userinterfaces/terminal_interface_win32.py
index 604fb6b..1001eda 100644
--- a/pywikibot/userinterfaces/terminal_interface_win32.py
+++ b/pywikibot/userinterfaces/terminal_interface_win32.py
@@ -1,6 +1,6 @@
 """User interface for Win32 terminals."""
 #
-# (C) Pywikibot team, 2003-2024
+# (C) Pywikibot team, 2003-2025
 #
 # Distributed under the terms of the MIT license.
 #
@@ -57,6 +57,7 @@
             addr = -12
         else:
             super().encounter_color(color, target_stream)
+            return

         from ctypes.wintypes import DWORD, HANDLE
         get_handle = ctypes.WINFUNCTYPE(HANDLE, DWORD)(

-- 
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1193560?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: I06007e07acfe2a64c564eaa553e4e897cbcf770d
Gerrit-Change-Number: 1193560
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