Fixed #10372: made `get_svn_revision()` more robust. Thanks, mboersma.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ffe8994014
commit
374b02e374
|
@ -19,8 +19,11 @@ def get_svn_revision(path=None):
|
||||||
path = django.__path__[0]
|
path = django.__path__[0]
|
||||||
entries_path = '%s/.svn/entries' % path
|
entries_path = '%s/.svn/entries' % path
|
||||||
|
|
||||||
if os.path.exists(entries_path):
|
try:
|
||||||
entries = open(entries_path, 'r').read()
|
entries = open(entries_path, 'r').read()
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
# Versions >= 7 of the entries file are flat text. The first line is
|
# Versions >= 7 of the entries file are flat text. The first line is
|
||||||
# the version number. The next set of digits after 'dir' is the revision.
|
# the version number. The next set of digits after 'dir' is the revision.
|
||||||
if re.match('(\d+)', entries):
|
if re.match('(\d+)', entries):
|
||||||
|
|
Loading…
Reference in New Issue