Skip to content

Commit 993b6aa

Browse files
committed
Don't use deprecated is_standard_module
1 parent ea6dd61 commit 993b6aa

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

pylint/checkers/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def _add_imported_module(self, node: ImportNode, importedmodname: str) -> None:
891891
if context_name == importedmodname:
892892
self.add_message("import-self", node=node)
893893

894-
elif not astroid.modutils.is_standard_module(importedmodname):
894+
elif not astroid.modutils.is_stdlib_module(importedmodname):
895895
# if this is not a package __init__ module
896896
if base != "__init__" and context_name not in self._module_pkg:
897897
# record the module's parent, or the module itself if this is

pylint/checkers/typecheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def _infer_from_metaclass_constructor(
790790
def _is_c_extension(module_node: InferenceResult) -> bool:
791791
return (
792792
isinstance(module_node, nodes.Module)
793-
and not astroid.modutils.is_standard_module(module_node.name)
793+
and not astroid.modutils.is_stdlib_module(module_node.name)
794794
and not module_node.fully_defined()
795795
)
796796

pylint/pyreverse/inspector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def compute_module(self, context_name: str, mod_path: str) -> int:
305305
package_dir = os.path.dirname(self.project.path)
306306
if context_name == mod_path:
307307
return 0
308-
if astroid.modutils.is_standard_module(mod_path, (package_dir,)):
308+
if astroid.modutils.module_in_path(mod_path, (package_dir,)):
309309
return 1
310310
return 0
311311

pylint/pyreverse/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def get_class_properties(self, obj: ClassEntity) -> NodeProperties:
136136
def get_shape_color(self, obj: DiagramEntity) -> str:
137137
"""Get shape color."""
138138
qualified_name = obj.node.qname()
139-
if modutils.is_standard_module(qualified_name.split(".", maxsplit=1)[0]):
139+
if modutils.is_stdlib_module(qualified_name.split(".", maxsplit=1)[0]):
140140
return "grey"
141141
if isinstance(obj.node, nodes.ClassDef):
142142
package = qualified_name.rsplit(".", maxsplit=2)[0]

tests/functional/u/ungrouped_imports_isort_compatible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import astroid
44
import isort
55
from astroid import are_exclusive, decorators
6-
from astroid.modutils import get_module_part, is_standard_module
6+
from astroid.modutils import get_module_part, is_stdlib_module

0 commit comments

Comments
 (0)