diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-09-23 21:31:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 21:31:10 +0200 |
commit | 6eb73d02c3af28a03a349bbb3d9bfbf888d09629 (patch) | |
tree | 0b7d4fe60277336df900b5cfd5dcbe7e7ccf8101 /astroid/manager.py | |
parent | 8559936fd1d2309b27514853bb1c344e04fd7579 (diff) | |
download | astroid-git-6eb73d02c3af28a03a349bbb3d9bfbf888d09629.tar.gz |
Handle empty ``modname`` in ``ast_from_module_name`` (#1801)
Diffstat (limited to 'astroid/manager.py')
-rw-r--r-- | astroid/manager.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/astroid/manager.py b/astroid/manager.py index e2f0d3fd..9f88c699 100644 --- a/astroid/manager.py +++ b/astroid/manager.py @@ -165,6 +165,8 @@ class AstroidManager: use_cache: bool = True, ) -> nodes.Module: """Given a module name, return the astroid object.""" + if modname is None: + raise AstroidBuildingError("No module name given.") # Sometimes we don't want to use the cache. For example, when we're # importing a module with the same name as the file that is importing # we want to fallback on the import system to make sure we get the correct |