summaryrefslogtreecommitdiff
path: root/astroid/manager.py
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2022-05-13 00:39:14 +0200
committerGitHub <noreply@github.com>2022-05-13 00:39:14 +0200
commitd616f2b08b8aae4ad835103e4ff7eb21a96cc2d4 (patch)
treef14658746d2370b1fe5ec06ce7cc7810c55774c9 /astroid/manager.py
parent58bbe0f77a3cdd4e91d4af719208e324334a869f (diff)
downloadastroid-git-d616f2b08b8aae4ad835103e4ff7eb21a96cc2d4.tar.gz
Update typing for Python 3.7 (1) (#1555)
Diffstat (limited to 'astroid/manager.py')
-rw-r--r--astroid/manager.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/astroid/manager.py b/astroid/manager.py
index 707caf1a..23330d5b 100644
--- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -7,11 +7,13 @@ possible by providing a class responsible to get astroid representation
from various source and using a cache of built modules)
"""
+from __future__ import annotations
+
import os
import types
import zipimport
from importlib.util import find_spec, module_from_spec
-from typing import TYPE_CHECKING, ClassVar, List, Optional
+from typing import TYPE_CHECKING, ClassVar
from astroid.const import BRAIN_MODULES_DIRECTORY
from astroid.exceptions import AstroidBuildingError, AstroidImportError
@@ -129,7 +131,7 @@ class AstroidManager:
return AstroidBuilder(self).string_build("", modname)
- def _build_namespace_module(self, modname: str, path: List[str]) -> "nodes.Module":
+ def _build_namespace_module(self, modname: str, path: list[str]) -> nodes.Module:
# pylint: disable=import-outside-toplevel; circular import
from astroid.builder import build_namespace_package_module
@@ -262,7 +264,7 @@ class AstroidManager:
raise value.with_traceback(None)
return value
- def ast_from_module(self, module: types.ModuleType, modname: Optional[str] = None):
+ def ast_from_module(self, module: types.ModuleType, modname: str | None = None):
"""given an imported module, return the astroid object"""
modname = modname or module.__name__
if modname in self.astroid_cache: