[pypy-svn] r61751 - pypy/trunk/pypy/lib/_ctypes

afa at codespeak.net afa at codespeak.net
Wed Feb 11 19:16:10 CET 2009


Author: afa
Date: Wed Feb 11 19:16:09 2009
New Revision: 61751

Modified:
   pypy/trunk/pypy/lib/_ctypes/__init__.py
   pypy/trunk/pypy/lib/_ctypes/basics.py
Log:
Add the simple _ctypes.COMError exception. Not yet used, except by a test.


Modified: pypy/trunk/pypy/lib/_ctypes/__init__.py
==============================================================================
--- pypy/trunk/pypy/lib/_ctypes/__init__.py	(original)
+++ pypy/trunk/pypy/lib/_ctypes/__init__.py	Wed Feb 11 19:16:09 2009
@@ -1,6 +1,6 @@
 from _ctypes.dummy import resize
 from _ctypes.basics import _CData, sizeof, alignment, byref, addressof,\
-     ArgumentError
+     ArgumentError, COMError
 from _ctypes.primitive import _SimpleCData
 from _ctypes.pointer import _Pointer, _cast_addr
 from _ctypes.function import CFuncPtr

Modified: pypy/trunk/pypy/lib/_ctypes/basics.py
==============================================================================
--- pypy/trunk/pypy/lib/_ctypes/basics.py	(original)
+++ pypy/trunk/pypy/lib/_ctypes/basics.py	Wed Feb 11 19:16:09 2009
@@ -26,6 +26,14 @@
 class ArgumentError(Exception):
     pass
 
+class COMError(Exception):
+    "Raised when a COM method call failed."
+    def __init__(self, hresult, text, details):
+        self.args = (hresult, text, details)
+        self.hresult = hresult
+        self.text = text
+        self.details = details
+
 class _CDataMeta(type):
     def from_param(self, value):
         if isinstance(value, self):



More information about the Pypy-commit mailing list