Skip to content

Commit 0d79b71

Browse files
committed
Fixed import error on linux.
1 parent e42e3b8 commit 0d79b71

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ def __init__(self, dist: Distribution) -> None:
99

1010
def run(self) -> None:
1111
super(install, self).run()
12-
os.environ["PYSDL3_DISABLE_DOCS"] = "0"
13-
sdl3 = __import__("sdl3")
1412

15-
if not (len(sdl3.functions) > 0):
16-
print("something went wrong.", flush = True)
13+
if sys.platform in ["win32"]:
14+
os.environ["PYSDL3_DISABLE_DOCS"] = "0"
15+
print("generating '__docs__.py'.", flush = True)
16+
sdl3 = __import__("sdl3")
17+
loaded = sum(len(v) for k, v in sdl3.functions.items())
1718

18-
else:
19-
print(f"loaded {len(sdl3.functions)} functions.", flush = True)
19+
if loaded > 0:
20+
print(f"loaded {loaded} functions.", flush = True)
21+
22+
else:
23+
print("something went wrong.", flush = True)
2024

2125
def main(argv):
2226
data = {
2327
"name": "PySDL3",
2428
"packages": ["sdl3", "sdl3.bin"],
25-
"version": "0.4.0a1",
29+
"version": "0.4.0a2",
2630
"description": "A pure Python wrapper for SDL3.",
2731
"long_description": open("README.md", "r", encoding = "utf-8").read(),
2832
"long_description_content_type": "text/markdown",

0 commit comments

Comments
 (0)