diff --git a/src/stubgen.py b/src/stubgen.py index 9098c50e..633e7dd3 100755 --- a/src/stubgen.py +++ b/src/stubgen.py @@ -683,7 +683,7 @@ def is_valid_module(module_name: str) -> bool: if mod_name == "builtins": # Simplify builtins return cls_name if cls_name != "NoneType" else "None" - if full_name.startswith(self.module.__name__): + if full_name.startswith(self.module.__name__ + "."): # Strip away the module prefix for local classes return full_name[len(self.module.__name__) + 1 :] elif mod_name == "typing" or mod_name == "collections.abc":