'Wait for the process to terminate or until timeout expires.
Returns returncode attribute. If timeout is None, then the method
will wait until the process terminates.
:param timeout: int or float representing the timeout in seconds'

def wait(self, timeout=None):

    if (timeout is None):
        timeout_millis = win32event.INFINITE
    else:
        timeout_millis = int((timeout * 1000))
    if (self.returncode is None):
        result = avoid_blocking_call(win32event.WaitForSingleObject, self._hProcess, timeout_millis)
        if (result == win32event.WAIT_TIMEOUT):
            raise ProcessException('Timeout    Exception.')
        self.returncode = win32process.GetExitCodeProcess(self._hProcess)
    return self.returncode
