1. Marcus von Appen
  2. py-sdl2


Marcus von Appen  committed 594710f

- Fixed #48: Be noisy on DLL load failures to avoid users fiddling around with
the warnings parameters.

  • Participants
  • Parent commits 91539ff
  • Branches default

Comments (0)

Files changed (1)

File sdl2/dll.py

View file
     return results
+class DLLWarning(Warning):
+    pass
 class DLL(object):
     """Function wrapper around the different DLL functions. Do not use or
     instantiate this one directly from your user code.
                 self._libfile = libfile
             except Exception as exc:
-                # Could not load it, silently ignore that issue and move
-                # to the next one.
-                warnings.warn(repr(exc), ImportWarning)
+                # Could not load the DLL, move to the next, but inform the user
+                # about something weird going on - this may become noisy, but
+                # is better than confusing the users with the RuntimeError below
+                warnings.warn(repr(exc), DLLWarning)
         if self._dll is None:
             raise RuntimeError("found %s, but it's not usable for the library %s" %
                                (foundlibs, libinfo))