Commits

Vinay Sajip committed 036af34

Allow a Distribution to be passed to DependencyFinder.find.

  • Participants
  • Parent commits 1852cf5

Comments (0)

Files changed (1)

File distlib/locators.py

         return result
 
     def find(self, requirement, tests=False):
-        dist = odist = self.locator.locate(requirement)
-        if dist is None:
-            raise ValueError('Unable to locate %r' % requirement)
+        if isinstance(requirement, Distribution):
+            dist = odist = requirement
+        else:
+            dist = odist = self.locator.locate(requirement)
+            if dist is None:
+                raise ValueError('Unable to locate %r' % requirement)
         dist.requested = True
         problems = set()
         todo = set([dist])