[PATCH evemu 2/5] python: check for _is_propfile attribute to exist

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 24 08:03:49 CEST 2013


If opening the file failed, _is_propfile isn't set and we get an error on del.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.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 044173c..87f5656 100644
--- a/python/evemu/__init__.py
+++ b/python/evemu/__init__.py
@@ -76,7 +76,7 @@ class Device(object):
                              self._file.fileno())
 
     def __del__(self):
-        if self._is_propfile:
+        if hasattr(self, "_is_propfile") and self._is_propfile:
             self._file.close()
             self._evemu._call(self._evemu.get_lib().evemu_destroy,
                               self._uinput)
-- 
1.8.3.1



More information about the Input-tools mailing list