jenkins-bot submitted this change.
[4.0] remove Python 2 related code
- also show a FutureWarning for depecated classes
Change-Id: I79e33c38ec00ece6e6f41d880663dba67d428e29
---
M pywikibot/userinterfaces/terminal_interface_win32.py
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py b/pywikibot/userinterfaces/terminal_interface_win32.py
index 898a847..3482ada 100755
--- a/pywikibot/userinterfaces/terminal_interface_win32.py
+++ b/pywikibot/userinterfaces/terminal_interface_win32.py
@@ -5,16 +5,10 @@
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
+import ctypes
from pywikibot.tools import ModuleDeprecationWrapper
-
-from pywikibot.userinterfaces import (
- terminal_interface_base,
- win32_unicode,
-)
-
-import ctypes
+from pywikibot.userinterfaces import terminal_interface_base, win32_unicode
windowsColors = {
'default': 7,
@@ -39,21 +33,21 @@
class Win32BaseUI(terminal_interface_base.UI):
- """DEPRECATED. User interface for Win32 terminals without ctypes."""
+ """DEPRECATED. User interface for Win32 terminals."""
def __init__(self):
"""Initializer."""
- super(Win32BaseUI, self).__init__()
+ super().__init__()
self.encoding = 'ascii'
class Win32UI(terminal_interface_base.UI):
- """User interface for Win32 terminals using ctypes."""
+ """User interface for Win32 terminals."""
def __init__(self):
"""Initializer."""
- super(Win32CtypesUI, self).__init__()
+ super().__init__()
(stdin, stdout, stderr, argv) = win32_unicode.get_unicode_console()
self.stdin = stdin
self.stdout = stdout
@@ -87,7 +81,7 @@
wrapper = ModuleDeprecationWrapper(__name__)
wrapper._add_deprecated_attr('Win32CtypesUI',
replacement_name='Win32UI',
- since='20190217')
+ since='20190217', future_warning=True)
wrapper._add_deprecated_attr('Win32BaseUI',
replacement_name='Win32UI',
- since='20190217')
+ since='20190217', future_warning=True)
To view, visit change 614583. To unsubscribe, or for help writing mail filters, visit settings.