Avoid error with svn >= 1.7 which does no longer have an entries-file to read from (fixes #1062)

This commit is contained in:
David Linke 2016-01-07 23:22:10 +01:00
parent 637ffc1b01
commit 25a84f1a02
1 changed files with 7 additions and 2 deletions

View File

@ -163,8 +163,13 @@ class Subversion(VersionControl):
def _get_svn_url_rev(self, location):
from pip.exceptions import InstallationError
with open(os.path.join(location, self.dirname, 'entries')) as f:
data = f.read()
entries_path = os.path.join(location, self.dirname, 'entries')
if os.path.exists(entries_path):
with open(entries_path) as f:
data = f.read()
else: # subversion >= 1.7 does not have the 'entries' file
data = ''
if (data.startswith('8') or
data.startswith('9') or
data.startswith('10')):