Commits

Marcus von Appen committed ca3a8f1

- improve bind_function() feedback on failure

  • Participants
  • Parent commits 9a7e4f4

Comments (0)

Files changed (1)

File utils/dll.py

         function."""
         func = getattr(self._dll, funcname, None)
         if not func:
-            func = optfunc
+            if optfunc:
+                warnings.warn\
+                    ("function '%s' not found in %r, using replacement" %
+                     (funcname, self._dll))
+                func = optfunc
+            else:
+                raise ValueError("could not find function '%s' in %r" %
+                                 (funcname, self._dll))
         func.argtypes = args
         func.restype = returns
         return func