From 346f1f5c8b7c9a76be7bbf7f5ff337edbd8db371 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Tue, 29 Jan 2008 13:52:37 -0700
Subject: [PATCH] _auto_deps: tolerate DistributionNotFound (but not
 VersionConflict), to accomodate distributions (i.e. gutsy) which provide our
 dependencies but don't include .egg-info files

---
 _auto_deps.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/_auto_deps.py b/_auto_deps.py
index 08ff2e77..97656ba8 100644
--- a/_auto_deps.py
+++ b/_auto_deps.py
@@ -18,7 +18,17 @@ def require_auto_deps():
         pass
     else:
         for requirement in install_requires:
-            pkg_resources.require(requirement)
+            try:
+                pkg_resources.require(requirement)
+            except pkg_resources.DistributionNotFound:
+                # there is no .egg-info present for this requirement, which
+                # either means that it isn't installed, or it is installed in
+                # a way that setuptools can't find it (but regular python
+                # might). The __import__ below will pass the second case,
+                # which is good enough for us. There are several
+                # distributions which provide our dependencies just fine, but
+                # they don't ship .egg-info files.
+                pass
     for requirement in install_requires:
         reqparts = requirement.split()
         name = reqparts[0]
-- 
2.45.2