From e4ab19caa7979f2ecedf223fac6a6dee69c25986 Mon Sep 17 00:00:00 2001 From: Hanno Schlichting Date: Thu, 16 Jul 2009 18:44:54 +0200 Subject: Allow to find_on_path on systems with tight permissions to fail gracefully. This closes #9. --HG-- branch : distribute extra : rebase_source : ff1f9a886a4524e59ea14f4063bf9074d0568082 --- pkg_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_resources.py b/pkg_resources.py index 87072b4d..ea01817b 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1649,7 +1649,7 @@ def find_on_path(importer, path_item, only=False): """Yield distributions accessible on a sys.path directory""" path_item = _normalize_cached(path_item) - if os.path.isdir(path_item): + if os.path.isdir(path_item) and os.access(path_item, os.R_OK): if path_item.lower().endswith('.egg'): # unpacked egg yield Distribution.from_filename( -- cgit v1.2.3