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