Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving DLL error messages #14

Closed
marcusva opened this issue Sep 3, 2013 · 1 comment
Closed

Improving DLL error messages #14

marcusva opened this issue Sep 3, 2013 · 1 comment

Comments

@marcusva
Copy link
Collaborator

marcusva commented Sep 3, 2013

Originally reported by: Roger Flores (Bitbucket: rallant92, GitHub: rallant92)


I installed the 64 bit sdl2 DLLs for my Win 7 x64 OS. Running (draw.py) reported

ImportError: could not load any library for SDL2

After some tracking, I figured out the Python was 32 bit, which can't use 64 bit libs. Specifically, exc at dll.py:57 is "[Error 193] %1 is not a valid Win32 application", raised from CDLL().

The import feedback could be more helpful. Mentioning that a dll file was found but not usable/suitable makes it clear that path issues aren't the source of the problem. So change dll.py:61 to
raise RuntimeError("found %s but it's not usable for the libary %s" % (foundlibs, libinfo))

dll.py:50 could become:
raise RuntimeError("searched %s but could not find any library for %s" % (path, libinfo))

It would also help to mention PYSDL2_DLL_PATH when there's a problem and it's unset so that people know about it.
dll.py:101:
if os.getenv("PYSDL2_DLL_PATH") == None:
exc = exc.message + " (and PYSDL2_DLL_PATH is unset)";


@marcusva
Copy link
Collaborator Author

marcusva commented Sep 6, 2013

Original comment by Marcus von Appen (Bitbucket: marcusva, GitHub: marcusva):


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant