[PATCH evemu 05/19] py: Raise statement takes one argument

Daniel Martin consume.noise at gmail.com
Mon Jan 6 09:38:05 PST 2014


Before Python 3 the exception message could've been passed as a second
argument to the raise statement. This is no longer the case and the
message has to be an argument on the exception. Adjust for that
incompatible change.

v2: Change the commit messages.

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