Merge pull request #840 from reicast/holzhaus/reicast-joyconfig-error-handling

Linux/reicast-joyconfig: Fix error handling for Python < 3.0
This commit is contained in:
Jan Holthuis 2015-09-22 15:10:34 +02:00
commit de29f0da76
1 changed files with 4 additions and 2 deletions

View File

@ -45,9 +45,11 @@ def clear_events(dev):
event = dev.read_one()
while(event is not None):
event = dev.read_one()
except BlockingIOError:
except (OSError, IOError):
# BlockingIOErrors should only occur if someone uses the evdev
# module < v0.4.4
# module < v0.4.4. BlockingIOError inherits from OSError, so we
# catch that for Python 2 compatibility. We also catch IOError,
# just in case.
pass