Skip to content

Commit

Permalink
Merge pull request #1830 from remram44/vcs-not-found_2
Browse files Browse the repository at this point in the history
Catches BadCommand in get_src_requirement()
  • Loading branch information
pfmoore committed Jun 12, 2014
2 parents 2f217b1 + 48a6958 commit 736400d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pip/vcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil

from pip.compat import urlparse, urllib
from pip.exceptions import BadCommand
from pip.log import logger
from pip.util import (display_path, backup_dir, find_command,
rmtree, ask_path_exists)
Expand Down Expand Up @@ -242,7 +243,15 @@ def get_src_requirement(self, dist, location, find_tags=False):
def get_src_requirement(dist, location, find_tags):
version_control = vcs.get_backend_from_location(location)
if version_control:
return version_control().get_src_requirement(dist, location, find_tags)
try:
return version_control().get_src_requirement(dist,
location,
find_tags)
except BadCommand:
logger.warn('cannot determine version of editable source in %s '
'(%s command not found in path)' % (
location, version_control.name))
return dist.as_requirement()
logger.warn(
'cannot determine version of editable source in %s (is not SVN '
'checkout, Git clone, Mercurial clone or Bazaar branch)' % location
Expand Down

0 comments on commit 736400d

Please sign in to comment.