File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,9 @@ def wait(self):
134
134
135
135
# wait for the pipe to open (the other end to be opened) and return fileobj to read/write
136
136
if win32pipe .ConnectNamedPipe (self ._pipe , None ):
137
- raise _win_error ()
137
+ code = win32api .GetLastError ()
138
+ if code != 535 : # ERROR_PIPE_CONNECTED (ok, just indicating that the client has already connected)(Issue#3)
139
+ raise _win_error (code )
138
140
139
141
# create new io stream object
140
142
stream = Win32RawIO (self ._pipe , self ._rd , self ._wr )
@@ -164,15 +166,15 @@ def __enter__(self):
164
166
def __exit__ (self , * _ ):
165
167
self .close ()
166
168
167
- def readable (self )-> bool :
168
- """True if pipe's stream is readable"""
169
+ def readable (self ) -> bool :
170
+ """True if pipe's stream is readable"""
169
171
return self ._rd
170
-
171
- def writable (self )-> bool :
172
- """True if pipe's stream is writable"""
172
+
173
+ def writable (self ) -> bool :
174
+ """True if pipe's stream is writable"""
173
175
return self ._wr
174
-
175
-
176
+
177
+
176
178
class Win32RawIO (io .RawIOBase ):
177
179
"""Raw I/O stream layer over open Windows pipe handle.
178
180
You can’t perform that action at this time.
0 commit comments