55See the file 'LICENSE' for copying permission
66"""
77
8+ from __future__ import division
9+
810import errno
911import os
1012import subprocess
1113import time
1214
1315from lib .core .compat import buffer
1416from lib .core .settings import IS_WIN
15- from thirdparty import six
1617
1718if IS_WIN :
1819 try :
@@ -98,7 +99,7 @@ def send(self, input):
9899 except ValueError :
99100 return self ._close ('stdin' )
100101 except (subprocess .pywintypes .error , Exception ) as ex :
101- if ( ex [0 ] if six . PY2 else ex . errno ) in (109 , errno .ESHUTDOWN ):
102+ if ex . args [0 ] in (109 , errno .ESHUTDOWN ):
102103 return self ._close ('stdin' )
103104 raise
104105
@@ -119,7 +120,7 @@ def _recv(self, which, maxsize):
119120 except (ValueError , NameError ):
120121 return self ._close (which )
121122 except (subprocess .pywintypes .error , Exception ) as ex :
122- if ( ex [0 ] if six . PY2 else ex . errno ) in (109 , errno .ESHUTDOWN ):
123+ if ex . args [0 ] in (109 , errno .ESHUTDOWN ):
123124 return self ._close (which )
124125 raise
125126
@@ -137,7 +138,7 @@ def send(self, input):
137138 try :
138139 written = os .write (self .stdin .fileno (), input )
139140 except OSError as ex :
140- if ( ex [0 ] if six . PY2 else ex . errno ) == errno .EPIPE : # broken pipe
141+ if ex . args [0 ] == errno .EPIPE : # broken pipe
141142 return self ._close ('stdin' )
142143 raise
143144
0 commit comments