Linux/reicast-joyconfig: Fix error handling for Python < 3.0

This commit is contained in:
Jan Holthuis 2015-09-22 15:09:12 +02:00
parent e04776caad
commit d843e0a020
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