-
Committer:
Tuomas Jorma Juhani Räsänen
-
Date:
2012-08-12 16:43:08 UTC
-
Revision ID:
git-v1:bc0448b82498995eafcd83038706220aa60855a8
Define Device.__uinput_dev in a fail-proof manner
Previously Device.__uinput_fd was defined only after succesful return
from suinput_open(). This resulted in slightly erroneous behavior in
cleanup stage, because Device.__del__() was assuming that
Device.__uinput_fd existed. However, when suinput_open() failed (for
example when the user did not have sufficient permissions to
/dev/uinput), Device.__uinput_fd did not exist at all, leading to a
slightly cryptic backtrace where AttributeError was the top-most
exception.