/ server_code / lazy_module_loader.py
lazy_module_loader.py
1 # SPDX-License-Identifier: MIT 2 # 3 # Copyright (c) 2021 The Anvil Extras project team members listed at 4 # https://github.com/anvilistas/anvil-extras/graphs/contributors 5 # 6 # This software is published at https://github.com/anvilistas/anvil-extras 7 8 __version__ = "3.1.0" 9 10 11 def __getattr__(name): 12 try: 13 mod = __import__(name) 14 except ImportError: 15 raise AttributeError(name) 16 globals()[name] = mod 17 return mod