From f049ca83d5004bd41ccd301762de5c5ab9f14473 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Thu, 6 Mar 2014 01:12:53 -0500 Subject: [PATCH] handle not found exception Change-Id: Id4a3d99da61bac50be02bee1213d38ea70b4c4ec Signed-off-by: Gui Chen --- mic/rt_util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mic/rt_util.py b/mic/rt_util.py index 05a3fc8..3897efc 100644 --- a/mic/rt_util.py +++ b/mic/rt_util.py @@ -156,13 +156,15 @@ def get_mic_binpath(): fp = None try: import pkg_resources # depends on 'setuptools' - except ImportError: - pass - else: dist = pkg_resources.get_distribution('mic') # the real script is under EGG_INFO/scripts if dist.has_metadata('scripts/mic'): fp = os.path.join(dist.egg_info, "scripts/mic") + except ImportError: + pass + except pkg_resources.DistributionNotFound: + pass + if fp: return fp -- 2.7.4