diff --git a/CHANGES.txt b/CHANGES.txt index c2ef4c4..1b9e9b5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,10 +5,6 @@ Py65 now requires Python 3.4 or later. On Python 2, Py65 now requires Python 2.7. - - Added a workaround to ignore an error ``Error: , - (25, 'Inappropriate ioctl for device')`` that may occur on some systems - when reading character input. Based on a patch by Marko Lauke. - 1.1.0 (2018-07-01) ------------------ diff --git a/py65/utils/console.py b/py65/utils/console.py index b111bc1..eb15df0 100644 --- a/py65/utils/console.py +++ b/py65/utils/console.py @@ -49,14 +49,9 @@ else: character. If no character is available, an empty string is returned. """ - char = '' fd = stdin.fileno() - try: - oldterm = termios.tcgetattr(fd) - except termios.error: # https://github.com/mnaberez/py65/issues/46 - return char - + oldterm = termios.tcgetattr(fd) newattr = oldterm[:] newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECHO termios.tcsetattr(fd, termios.TCSANOW, newattr) @@ -65,6 +60,7 @@ else: fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK) try: + char = '' r, w, e = select.select([fd], [], [], 0.1) if r: char = stdin.read(1)