diff options
author | Georg Brandl <georg@python.org> | 2011-10-07 19:17:01 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-10-07 19:17:01 +0200 |
commit | 035aa3ff43ca15355bc9469a992cebac3d6bccfc (patch) | |
tree | 39068fdc6cbf50dd1b3fd8c2a8052a281deb8717 | |
parent | 3d666eb0b3f4d3243f1686c9d9e959f5857e24fe (diff) | |
download | sphinx-035aa3ff43ca15355bc9469a992cebac3d6bccfc.tar.gz |
Fix the source positions referenced by the "viewcode" extension.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | sphinx/pycode/__init__.py | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -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) |