diff --git a/appveyor.yml b/appveyor.yml index 8c00947..bcc1a4e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,6 +41,7 @@ after_test: # Upload to pypi. # More precisely. Upload pypi the master builds, and to test-pypi any other builds. + # See more at https://stackoverflow.com/a/33662275/2506522 - git branch | find "* master" > NUL & IF ERRORLEVEL 1 ( \ twine upload -r testpypi dist\\wexpect*.tar.gz \ ) ELSE ( \ diff --git a/wexpect.py b/wexpect.py index 429f0f6..78454da 100644 --- a/wexpect.py +++ b/wexpect.py @@ -2071,12 +2071,12 @@ class Wtty: logging.info(e) # In case of any error: We "switch back" (attach) our original console, then raise the # error. - win32console.AttachConsole(self.__parentPid) + self.switchBack() raise EOF('End Of File (EOF) in switchTo().') except: # In case of any error: We "switch back" (attach) our original console, then raise the # error. - win32console.AttachConsole(self.__parentPid) + self.switchBack() raise