evemu-0007-python-fix-device-open-for-python3.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From f192db7848962a1616e243bb60e705da6c6f3412 Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Sun, 27 Apr 2014 01:16:16 +0200
  4. Subject: [PATCH] python: fix device open for python3
  5. - use 'rb' instead of 'r+b', fixes:
  6. >>> import evemu
  7. >>> evemu.Device('/dev/input/event0')
  8. Traceback (most recent call last):
  9. File "<stdin>", line 1, in <module>
  10. File "/usr/lib/python3.4/site-packages/evemu/__init__.py", line 50, in __init__
  11. io.UnsupportedOperation: File or stream is not seekable.
  12. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  13. ---
  14. python/evemu/__init__.py | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
  17. index abdbf7e..aa73871 100644
  18. --- a/python/evemu/__init__.py
  19. +++ b/python/evemu/__init__.py
  20. @@ -47,7 +47,7 @@ class Device(object):
  21. """
  22. if type(f).__name__ == 'str':
  23. - self._file = open(f, 'r+b')
  24. + self._file = open(f, 'rb')
  25. elif type(f).__name__ == 'file':
  26. self._file = f
  27. else:
  28. --
  29. 1.8.1.4