From dab5555503b07fe3e1f730a2bdebd97f4b535c8c Mon Sep 17 00:00:00 2001 From: linkmauve Date: Thu, 19 Dec 2019 00:51:29 +0100 Subject: [PATCH] Update colout.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python 2 will retire in thirteen days (see https://pythonclock.org/), there is no reason to keep obsolete checks in the code any longer. --- colout/colout.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/colout/colout.py b/colout/colout.py index 29ca071..b346d0e 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -30,8 +30,6 @@ signal.signal( signal.SIGPIPE, signal.SIG_DFL ) # Global variable(s) ############################################################################### -PY2 = sys.version_info.major == 2 - context = {} debug = False @@ -757,9 +755,6 @@ def write(colored, stream = sys.stdout): """ Write "colored" on sys.stdout, then flush. """ - if PY2: # If Python 2.x: force unicode - if isinstance(colored, unicode): - colored = colored.encode('utf-8') try: stream.write(colored) stream.flush()