summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-04-03 20:29:59 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-04-03 20:29:59 +0000
commitb45cf13bed36f338517c42446f78001aa9a82f7d (patch)
treeaec5b42db57bc125134c39ddbaeb1eb6a70bfcef /django/utils
parentfbffc2e943eba73715d1564f437ca4ee028de9d3 (diff)
[1.0.X] Fixed #10372: made `get_svn_revision()` more robust. Thanks, mboersma. Backport of r10377 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/version.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/version.py b/django/utils/version.py
index cf8085653f..557135fc35 100644
--- a/django/utils/version.py
+++ b/django/utils/version.py
@@ -19,8 +19,11 @@ def get_svn_revision(path=None):
path = django.__path__[0]
entries_path = '%s/.svn/entries' % path
- if os.path.exists(entries_path):
+ try:
entries = open(entries_path, 'r').read()
+ except IOError:
+ pass
+ else:
# 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.
if re.match('(\d+)', entries):