File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,9 @@ def wait(self):
134134
135135 # wait for the pipe to open (the other end to be opened) and return fileobj to read/write
136136 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 )
138140
139141 # create new io stream object
140142 stream = Win32RawIO (self ._pipe , self ._rd , self ._wr )
@@ -164,15 +166,15 @@ def __enter__(self):
164166 def __exit__ (self , * _ ):
165167 self .close ()
166168
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"""
169171 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"""
173175 return self ._wr
174-
175-
176+
177+
176178class Win32RawIO (io .RawIOBase ):
177179 """Raw I/O stream layer over open Windows pipe handle.
178180
You can’t perform that action at this time.
0 commit comments