3030###
3131
3232import re
33- import sys
34- import types
3533import codecs
36- import base64
3734import binascii
3835import unicodedata
3936
4037import supybot .utils as utils
4138from supybot .commands import *
42- import supybot .utils .minisix as minisix
4339import supybot .plugins as plugins
4440import supybot .commands as commands
4541import supybot .ircutils as ircutils
@@ -120,9 +116,7 @@ def encode(self, irc, msg, args, encoding, text):
120116 text = codecs .getencoder ('base64_codec' )(text )[0 ].decode ()
121117
122118 # Change result into a string
123- if minisix .PY2 and isinstance (text , unicode ):
124- text = text .encode ('utf-8' )
125- elif minisix .PY3 and isinstance (text , bytes ):
119+ if isinstance (text , bytes ):
126120 text = text .decode ()
127121
128122 if encoding in ('base64' , 'base64_codec' ):
@@ -152,7 +146,7 @@ def decode(self, irc, msg, args, encoding, text):
152146 decoder = codecs .getdecoder (encoding )
153147 except LookupError :
154148 irc .errorInvalid (_ ('encoding' ), encoding )
155- if minisix . PY3 and not isinstance (text , bytes ):
149+ if not isinstance (text , bytes ):
156150 text = text .encode ()
157151 try :
158152 text = decoder (text )[0 ]
@@ -163,9 +157,7 @@ def decode(self, irc, msg, args, encoding, text):
163157 return
164158
165159 # Change result into a string
166- if minisix .PY2 and isinstance (text , unicode ):
167- text = text .encode ('utf-8' )
168- elif minisix .PY3 and isinstance (text , bytes ):
160+ if isinstance (text , bytes ):
169161 try :
170162 text = text .decode ()
171163 except UnicodeDecodeError :
0 commit comments