mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-22 06:10:51 -07:00
ci(M01): return '' for __file__ so inspect.getfile works
Made-with: Cursor
This commit is contained in:
parent
1e958a4e2a
commit
267de8c5ca
1 changed files with 5 additions and 0 deletions
|
|
@ -46,6 +46,11 @@ class _StubModule(types.ModuleType):
|
|||
"""Resolves any attribute as submodule or stub class."""
|
||||
|
||||
def __getattr__(self, name):
|
||||
# Special attrs: avoid creating submodules, satisfy inspect
|
||||
if name == "__file__":
|
||||
return ""
|
||||
if name == "__path__":
|
||||
return []
|
||||
module_name = f"{self.__name__}.{name}"
|
||||
if module_name not in sys.modules:
|
||||
if name and name[0].isupper():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue