@@ -1,100 +1,127 @@
1−diff -ru PySDL2-0.9.7-old/sdl2/dll.py PySDL2-0.9.7/sdl2/dll.py
2−--- PySDL2-0.9.7-old/sdl2/dll.py 2020-02-15 09:36:29.000000000 +0100
3−+++ PySDL2-0.9.7/sdl2/dll.py 2020-09-23 20:24:09.365497270 +0200
4−@@ -94,15 +94,16 @@
5− """Function wrapper around the different DLL functions. Do not use or
6− instantiate this one directly from your user code.
7− """
8−- def __init__(self, libinfo, libnames, path=None):
9−+ def __init__(self, libinfo, libfile):
10− self._dll = None
11− self._libname = libinfo
12− self._version = None
13−- foundlibs = _findlib(libnames, path)
14−- dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
15−- if len(foundlibs) == 0:
16−- raise RuntimeError("could not find any library for %s (%s)" %
17−- (libinfo, dllmsg))
18−+ #foundlibs = _findlib(libnames, path)
19−+ #dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
20−+ #if len(foundlibs) == 0:
21−+ # raise RuntimeError("could not find any library for %s (%s)" %
22−+ # (libinfo, dllmsg))
23−+ foundlibs = [ libfile ]
24− for libfile in foundlibs:
25− try:
26− self._dll = CDLL(libfile)
27−@@ -117,9 +118,9 @@
28− if self._dll is None:
29− raise RuntimeError("found %s, but it's not usable for the library %s" %
30− (foundlibs, libinfo))
31−- if path is not None and sys.platform in ("win32",) and \
32−- path in self._libfile:
33−- os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
34−+ #if path is not None and sys.platform in ("win32",) and \
35−+ # path in self._libfile:
36−+ # os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
37−
38− def bind_function(self, funcname, args=None, returns=None, added=None):
39− """Binds the passed argument and return value types to the specified
40−@@ -220,7 +221,7 @@
41− return
42−
43− try:
44−- dll = DLL("SDL2", ["SDL2", "SDL2-2.0"], os.getenv("PYSDL2_DLL_PATH"))
45−+ dll = DLL("SDL2", "@sdl2@")
46− except RuntimeError as exc:
47− raise ImportError(exc)
48−
49−diff -ru PySDL2-0.9.7-old/sdl2/sdlgfx.py PySDL2-0.9.7/sdl2/sdlgfx.py
50−--- PySDL2-0.9.7-old/sdl2/sdlgfx.py 2020-02-02 11:07:00.000000000 +0100
51−+++ PySDL2-0.9.7/sdl2/sdlgfx.py 2020-09-23 20:23:56.997419129 +0200
52−@@ -39,8 +39,7 @@
53− ]
54−
55− try:
56−- dll = DLL("SDL2_gfx", ["SDL2_gfx", "SDL2_gfx-1.0"],
57−- os.getenv("PYSDL2_DLL_PATH"))
58−+ dll = DLL("SDL2_gfx", "@sdl2_gfx@")
59− except RuntimeError as exc:
60− raise ImportError(exc)
61−
62−diff -ru PySDL2-0.9.7-old/sdl2/sdlimage.py PySDL2-0.9.7/sdl2/sdlimage.py
63−--- PySDL2-0.9.7-old/sdl2/sdlimage.py 2020-02-02 11:07:00.000000000 +0100
64−+++ PySDL2-0.9.7/sdl2/sdlimage.py 2020-09-23 20:23:50.085375658 +0200
65−@@ -27,8 +27,7 @@
66− ]
67−
68− try:
69−- dll = DLL("SDL2_image", ["SDL2_image", "SDL2_image-2.0"],
70−- os.getenv("PYSDL2_DLL_PATH"))
71−+ dll = DLL("SDL2_image", "@sdl2_image@")
72− except RuntimeError as exc:
73− raise ImportError(exc)
74−
75−diff -ru PySDL2-0.9.7-old/sdl2/sdlmixer.py PySDL2-0.9.7/sdl2/sdlmixer.py
76−--- PySDL2-0.9.7-old/sdl2/sdlmixer.py 2020-02-02 11:07:00.000000000 +0100
77−+++ PySDL2-0.9.7/sdl2/sdlmixer.py 2020-09-23 20:23:46.117350771 +0200
78−@@ -53,8 +53,7 @@
79− ]
80−
81− try:
82−- dll = DLL("SDL2_mixer", ["SDL2_mixer", "SDL2_mixer-2.0"],
83−- os.getenv("PYSDL2_DLL_PATH"))
84−+ dll = DLL("SDL2_mixer", "@sdl2_mixer@")
85− except RuntimeError as exc:
86− raise ImportError(exc)
87−
88−diff -ru PySDL2-0.9.7-old/sdl2/sdlttf.py PySDL2-0.9.7/sdl2/sdlttf.py
89−--- PySDL2-0.9.7-old/sdl2/sdlttf.py 2020-02-02 11:07:00.000000000 +0100
90−+++ PySDL2-0.9.7/sdl2/sdlttf.py 2020-09-23 20:23:40.069312931 +0200
91−@@ -39,8 +39,7 @@
92− ]
93−
94− try:
95−- dll = DLL("SDL2_ttf", ["SDL2_ttf", "SDL2_ttf-2.0"],
96−- os.getenv("PYSDL2_DLL_PATH"))
97−+ dll = DLL("SDL2_ttf", "@sdl2_ttf@")
98− except RuntimeError as exc:
99− raise ImportError(exc)
100−
1+diff --git a/sdl2/dll.py b/sdl2/dll.py
2+index 6e30259..12e1f7d 100644
3+--- a/sdl2/dll.py
4++++ b/sdl2/dll.py
5+@@ -145,7 +145,7 @@ class DLL(object):
6+ """Function wrapper around the different DLL functions. Do not use or
7+ instantiate this one directly from your user code.
8+ """
9+- def __init__(self, libinfo, libnames, path=None):
10++ def __init__(self, libinfo, libfile):
11+ self._dll = None
12+ self._deps = None
13+ self._libname = libinfo
14+@@ -157,11 +157,12 @@ class DLL(object):
15+ "SDL2_image": 2001,
16+ "SDL2_gfx": 1003
17+ }
18+- foundlibs = _findlib(libnames, path)
19+- dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
20+- if len(foundlibs) == 0:
21+- raise RuntimeError("could not find any library for %s (%s)" %
22+- (libinfo, dllmsg))
23++ #foundlibs = _findlib(libnames, path)
24++ #dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
25++ #if len(foundlibs) == 0:
26++ # raise RuntimeError("could not find any library for %s (%s)" %
27++ # (libinfo, dllmsg))
28++ foundlibs = [ libfile ]
29+ for libfile in foundlibs:
30+ try:
31+ self._dll = CDLL(libfile)
32+@@ -185,19 +186,19 @@ class DLL(object):
33+ (foundlibs, libinfo))
34+ if _using_ms_store_python():
35+ self._deps = _preload_deps(libinfo, self._libfile)
36+- if path is not None and sys.platform in ("win32",) and \
37+- path in self._libfile:
38+- os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
39++ #if path is not None and sys.platform in ("win32",) and \
40++ # path in self._libfile:
41++ # os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
42+
43+ def bind_function(self, funcname, args=None, returns=None, added=None):
44+ """Binds the passed argument and return value types to the specified
45+ function. If the version of the loaded library is older than the
46+ version where the function was added, an informative exception will
47+ be raised if the bound function is called.
48+
49+ Args:
50+ funcname (str): The name of the function to bind.
51+ args (List or None, optional): The data types of the C function's
52+ arguments. Should be 'None' if function takes no arguments.
53+ returns (optional): The return type of the bound C function. Should
54+ be 'None' if function returns 'void'.
55+@@ -288,7 +289,7 @@ def nullfunc(*args):
56+ return
57+
58+ try:
59+- dll = DLL("SDL2", ["SDL2", "SDL2-2.0", "SDL2-2.0.0"], os.getenv("PYSDL2_DLL_PATH"))
60++ dll = DLL("SDL2", "@sdl2@")
61+ except RuntimeError as exc:
62+ raise ImportError(exc)
63+
64+diff --git a/sdl2/sdlgfx.py b/sdl2/sdlgfx.py
65+index 090752e..a8a7488 100644
66+--- a/sdl2/sdlgfx.py
67++++ b/sdl2/sdlgfx.py
68+@@ -50,8 +50,7 @@ __all__ = [
69+
70+
71+ try:
72+- dll = DLL("SDL2_gfx", ["SDL2_gfx", "SDL2_gfx-1.0"],
73+- os.getenv("PYSDL2_DLL_PATH"))
74++ dll = DLL("SDL2_gfx", "@sdl2_gfx@")
75+ except RuntimeError as exc:
76+ raise ImportError(exc)
77+
78+diff --git a/sdl2/sdlimage.py b/sdl2/sdlimage.py
79+index a6884e8..95d96df 100644
80+--- a/sdl2/sdlimage.py
81++++ b/sdl2/sdlimage.py
82+@@ -32,15 +32,14 @@ __all__ = [
83+ "IMG_LoadXCF_RW", "IMG_LoadWEBP_RW", "IMG_LoadXPM_RW",
84+ "IMG_LoadXV_RW", "IMG_ReadXPMFromArray",
85+ "IMG_GetError", "IMG_SetError", "IMG_SaveJPG", "IMG_SaveJPG_RW",
86+-
87++
88+ # Python Functions
89+ "get_dll_file"
90+ ]
91+
92+
93+ try:
94+- dll = DLL("SDL2_image", ["SDL2_image", "SDL2_image-2.0"],
95+- os.getenv("PYSDL2_DLL_PATH"))
96++ dll = DLL("SDL2_image", "@sdl2_image@")
97+ except RuntimeError as exc:
98+ raise ImportError(exc)
99+
100+diff --git a/sdl2/sdlmixer.py b/sdl2/sdlmixer.py
101+index 9ad9b85..1c36289 100644
102+--- a/sdl2/sdlmixer.py
103++++ b/sdl2/sdlmixer.py
104+@@ -76,8 +76,7 @@ __all__ = [
105+ ]
106+
107+ try:
108+- dll = DLL("SDL2_mixer", ["SDL2_mixer", "SDL2_mixer-2.0"],
109+- os.getenv("PYSDL2_DLL_PATH"))
110++ dll = DLL("SDL2_mixer", "@sdl2_mixer@")
111+ except RuntimeError as exc:
112+ raise ImportError(exc)
113+
114+diff --git a/sdl2/sdlttf.py b/sdl2/sdlttf.py
115+index 9c2d951..bd5a16a 100644
116+--- a/sdl2/sdlttf.py
117++++ b/sdl2/sdlttf.py
118+@@ -54,8 +54,7 @@ __all__ = [
119+
120+
121+ try:
122+- dll = DLL("SDL2_ttf", ["SDL2_ttf", "SDL2_ttf-2.0"],
123+- os.getenv("PYSDL2_DLL_PATH"))
124++ dll = DLL("SDL2_ttf", "@sdl2_ttf@")
125+ except RuntimeError as exc:
126+ raise ImportError(exc)
127+