[pyatspi2] Perform type checking on Enumeration equality.



commit 6814bacfe49a2199daa878b28dfbff850e816116
Author: Mark Doffman <mark doffman codethink co uk>
Date:   Fri Dec 18 05:36:22 2009 -0800

    Perform type checking on Enumeration equality.

 pyatspi/enum.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/pyatspi/enum.py b/pyatspi/enum.py
index df3fbdd..e31540a 100644
--- a/pyatspi/enum.py
+++ b/pyatspi/enum.py
@@ -27,10 +27,13 @@ class Enum(UInt32):
         def __eq__(self, other):
                 if other is None:
                         return False
-                if int(self) == int(other):
-                        return True
-                else:
-                        return False
+		try:
+                	if int(self) == int(other):
+                        	return True
+                	else:
+                        	return False
+		except ValueError:
+			return False
 
         def __hash__(self):
                 return int(self)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]