forked from VimPlug/jedi
Catch 'PermissionError' for unreadable directories
This commit is contained in:
@@ -366,8 +366,11 @@ class Project:
|
|||||||
|
|
||||||
def _is_potential_project(path):
|
def _is_potential_project(path):
|
||||||
for name in _CONTAINS_POTENTIAL_PROJECT:
|
for name in _CONTAINS_POTENTIAL_PROJECT:
|
||||||
if path.joinpath(name).exists():
|
try:
|
||||||
return True
|
if path.joinpath(name).exists():
|
||||||
|
return True
|
||||||
|
except PermissionError:
|
||||||
|
continue
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,11 @@ def _get_paths_from_buildout_script(inference_state, buildout_script_path):
|
|||||||
|
|
||||||
def _get_parent_dir_with_file(path: Path, filename):
|
def _get_parent_dir_with_file(path: Path, filename):
|
||||||
for parent in path.parents:
|
for parent in path.parents:
|
||||||
if parent.joinpath(filename).is_file():
|
try:
|
||||||
return parent
|
if parent.joinpath(filename).is_file():
|
||||||
|
return parent
|
||||||
|
except PermissionError:
|
||||||
|
continue
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user