summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-10-07 19:17:01 +0200
committerGeorg Brandl <georg@python.org>2011-10-07 19:17:01 +0200
commit035aa3ff43ca15355bc9469a992cebac3d6bccfc (patch)
tree39068fdc6cbf50dd1b3fd8c2a8052a281deb8717
parent3d666eb0b3f4d3243f1686c9d9e959f5857e24fe (diff)
downloadsphinx-035aa3ff43ca15355bc9469a992cebac3d6bccfc.tar.gz
Fix the source positions referenced by the "viewcode" extension.
-rw-r--r--CHANGES2
-rw-r--r--sphinx/pycode/__init__.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 492e39f1..02547e32 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@ Release 1.0.9 (in development)
* #778: Fix "hide search matches" link on pages linked by search.
+* Fix the source positions referenced by the "viewcode" extension.
+
Release 1.0.8 (Sep 23, 2011)
============================
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index ec4913a3..403269cd 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -193,6 +193,7 @@ class ModuleAnalyzer(object):
# cache the source code as well
pos = self.source.tell()
self.encoding = detect_encoding(self.source.readline)
+ self.source.seek(pos)
self.code = self.source.read()
self.source.seek(pos)