jenkins-bot submitted this change.
[4.0] remove Python 2 related code
Change-Id: Ib217a6d9efa2bfda1847f120e0480c446d4f334f
---
M pywikibot/userinterfaces/terminal_interface_unix.py
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/pywikibot/userinterfaces/terminal_interface_unix.py b/pywikibot/userinterfaces/terminal_interface_unix.py
index 3225ed6..6f2cd8f 100755
--- a/pywikibot/userinterfaces/terminal_interface_unix.py
+++ b/pywikibot/userinterfaces/terminal_interface_unix.py
@@ -1,16 +1,12 @@
# -*- coding: utf-8 -*-
"""User interface for unix terminals."""
#
-# (C) Pywikibot team, 2003-2019
+# (C) Pywikibot team, 2003-2020
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
-
import re
-from pywikibot.tools import PY2
-
from pywikibot.userinterfaces import terminal_interface_base
unixColors = {
@@ -58,10 +54,4 @@
def _write(self, text, target_stream):
"""Optionally encode and write the text to the target stream."""
- if PY2:
- encoding = getattr(target_stream, 'encoding', None)
- if encoding:
- text = text.encode(encoding, 'replace').decode(encoding)
- else:
- text = text.encode(self.encoding, 'replace')
target_stream.write(text)
To view, visit change 614581. To unsubscribe, or for help writing mail filters, visit settings.