summaryrefslogtreecommitdiff
path: root/pylint/lint/expand_modules.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/lint/expand_modules.py')
-rw-r--r--pylint/lint/expand_modules.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py
index bb25986e4..1e8fd032f 100644
--- a/pylint/lint/expand_modules.py
+++ b/pylint/lint/expand_modules.py
@@ -1,12 +1,11 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
-# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
from __future__ import annotations
import os
import sys
-import warnings
from collections.abc import Sequence
from re import Pattern
@@ -24,18 +23,6 @@ def _modpath_from_file(filename: str, is_namespace: bool, path: list[str]) -> li
)
-def get_python_path(filepath: str) -> str:
- # TODO: Remove deprecated function
- warnings.warn(
- "get_python_path has been deprecated because assumption that there's always an __init__.py "
- "is not true since python 3.3 and is causing problems, particularly with PEP 420."
- "Use discover_package_path and pass source root(s).",
- DeprecationWarning,
- stacklevel=2,
- )
- return discover_package_path(filepath, [])
-
-
def discover_package_path(modulepath: str, source_roots: Sequence[str]) -> str:
"""Discover package path from one its modules and source roots."""
dirname = os.path.realpath(os.path.expanduser(modulepath))
@@ -101,7 +88,7 @@ def expand_modules(
):
continue
module_package_path = discover_package_path(something, source_roots)
- additional_search_path = [".", module_package_path] + path
+ additional_search_path = [".", module_package_path, *path]
if os.path.exists(something):
# this is a file or a directory
try: