From eaa9b87990e6db054ab55e29aa966bbd1f252f87 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Thu, 9 Jan 2025 16:27:19 +0100 Subject: [PATCH] Made the module import pygame only when needed. --- wobbl_tools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wobbl_tools/__init__.py b/wobbl_tools/__init__.py index 1751df7..56e63df 100644 --- a/wobbl_tools/__init__.py +++ b/wobbl_tools/__init__.py @@ -1,4 +1,7 @@ #!/usr/bin/python3 -from .pygame_tools import pgui +def __getattr__(name): + if name == "pgui": + from .pygame_tools import pgui + return pgui