@@ -162,7 +162,7 @@ def write(self, message='', **kwargs):
162162 if self ._output is None :
163163 return
164164 end = kwargs .pop ('end' , "\n " )
165- if not isinstance (message , six . string_types ):
165+ if not isinstance (message , str ):
166166 message = str (message )
167167 self ._output .write (message + end )
168168
@@ -175,7 +175,7 @@ def writei(self, fmt, *args, **kwargs):
175175 @param self This object.
176176 @param fmt Format string using printf-style "%" formatters.
177177 """
178- assert isinstance (fmt , six . string_types )
178+ assert isinstance (fmt , str )
179179 message = fmt % args
180180 self .write (message , ** kwargs )
181181
@@ -188,7 +188,7 @@ def writef(self, fmt, *args, **kwargs):
188188 @param self This object.
189189 @param fmt Format string using the format() mini-language.
190190 """
191- assert isinstance (fmt , six . string_types )
191+ assert isinstance (fmt , str )
192192 message = fmt .format (* args , ** kwargs )
193193 self .write (message , ** kwargs )
194194
@@ -394,7 +394,7 @@ def handle_python(self, invocation):
394394
395395 result = eval (invocation .cmd , globals (), self ._python_namespace )
396396 if result is not None :
397- if isinstance (result , six . integer_types ):
397+ if isinstance (result , str ):
398398 self .writei ("0x%08x (%d)" , result , result )
399399 else :
400400 w , h = get_terminal_size ()
@@ -411,4 +411,4 @@ def handle_system(self, invocation):
411411 output = subprocess .check_output (invocation .cmd , stderr = subprocess .STDOUT , shell = True )
412412 self .write (six .ensure_str (output ), end = '' )
413413 except subprocess .CalledProcessError as err :
414- six . raise_from ( exceptions .CommandError (str (err )), err )
414+ raise exceptions .CommandError (str (err )) from err
0 commit comments