py-sdl2 / sdl2 / dll.py

Diff from to

sdl2/dll.py

     def __init__(self, libinfo, libnames, path=None):
         self._dll = None
         foundlibs = _findlib(libnames, path)
+        dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
         if len(foundlibs) == 0:
-            raise RuntimeError("could not find any library for %s" % libinfo)
+            raise RuntimeError("could not find any library for %s (%s)" %
+                               (libinfo, dllmsg))
         for libfile in foundlibs:
             try:
                 self._dll = CDLL(libfile)
                 # to the next one.
                 warnings.warn(repr(exc), ImportWarning)
         if self._dll is None:
-            raise RuntimeError("could not load any library for %s" % libinfo)
+            raise RuntimeError("found %s, but it's not usable for the libary %s" %
+                               (foundlibs, libinfo))
         if path is not None and sys.platform in ("win32", "cli") and \
             path in self._libfile:
             os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
             if optfunc:
                 warnings.warn\
                     ("function '%s' not found in %r, using replacement" %
-                     (funcname, self._dll))
+                     (funcname, self._dll), ImportWarning)
                 func = _nonexistent(funcname, optfunc)
             else:
                 raise ValueError("could not find function '%s' in %r" %
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.