1. James Lan
  2. pypesocket

Commits

James Lan  committed 317364b

map Windows' ERROR_FILE_NOT_FOUND to posix' ENOENT

  • Participants
  • Parent commits 9daf8cb
  • Branches default

Comments (0)

Files changed (1)

File pypesocketwin.py

View file
 _PIPE_WAIT = 0
 _PIPE_UNLIMITED_INSTANCES = 255
 _NMPWAIT_USE_DEFAULT_WAIT = 0
+_ERROR_FILE_NOT_FOUND = 2
 _ERROR_PIPE_CONNECTED = 535
 _ERROR_PIPE_BUSY = 231
 _GENERIC_READ = 0x80000000
                 return
                 # failed to connect, see if server isn't ready
             err = _kernel32.GetLastError()
+            if err == _ERROR_FILE_NOT_FOUND:
+                raise socket.error(errno.ENOENT)
             if err != _ERROR_PIPE_BUSY:
                 raise socket.error(str(err)) # todo: should be meaningful text
-                # retry
+            # retry
             time.sleep(timeout)
             timeout *= 2
         else: