[PATCH evemu 05/11] py: Raise exception objects
Daniel Martin
consume.noise at gmail.com
Thu Jan 2 13:47:55 PST 2014
In Python 3 one has to throw an exception object. The statement variant
doesn't work anymore.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
python/evemu/base.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/evemu/base.py b/python/evemu/base.py
index b3e3234..0f2fa97 100644
--- a/python/evemu/base.py
+++ b/python/evemu/base.py
@@ -17,15 +17,15 @@ class EvEmuBase(object):
def _call0(self, api_call, *parameters):
result = api_call(*parameters)
if result == 0 and self.get_c_errno() != 0:
- raise exception.ExecutionError, "%s: %s" % (
- api_call.__name__, self.get_c_error())
+ raise exception.ExecutionError("%s: %s" % (
+ api_call.__name__, self.get_c_error()))
return result
def _call(self, api_call, *parameters):
result = api_call(*parameters)
if result < 0 and self.get_c_errno() != 0:
- raise exception.ExecutionError, "%s: %s" % (
- api_call.__name__, self.get_c_error())
+ raise exception.ExecutionError("%s: %s" % (
+ api_call.__name__, self.get_c_error()))
return result
def get_c_errno(self):
--
1.8.5.2
More information about the Input-tools
mailing list