File tree Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 4848 report_total_messages_stats ,
4949)
5050from pylint .lint .utils import (
51- _is_relative_to ,
5251 augmented_sys_path ,
5352 get_fatal_error_message ,
5453 prepare_crash_report ,
@@ -918,7 +917,7 @@ def _get_namespace_for_file(
918917 self , filepath : Path , namespaces : DirectoryNamespaceDict
919918 ) -> argparse .Namespace | None :
920919 for directory in namespaces :
921- if _is_relative_to (filepath , directory ):
920+ if Path . is_relative_to (filepath , directory ):
922921 namespace = self ._get_namespace_for_file (
923922 filepath , namespaces [directory ][1 ]
924923 )
Original file line number Diff line number Diff line change @@ -133,16 +133,3 @@ def augmented_sys_path(additional_paths: Sequence[str]) -> Iterator[None]:
133133 yield
134134 finally :
135135 sys .path [:] = original
136-
137-
138- def _is_relative_to (self : Path , * other : Path ) -> bool :
139- """Checks if self is relative to other.
140-
141- Backport of pathlib.Path.is_relative_to for Python <3.9
142- TODO: py39: Remove this backport and use stdlib function.
143- """
144- try :
145- self .relative_to (* other )
146- return True
147- except ValueError :
148- return False
You can’t perform that action at this time.
0 commit comments