summaryrefslogtreecommitdiff
path: root/sphinx/ext/oldcmarkup.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-09-23 09:46:24 +0200
committerGeorg Brandl <georg@python.org>2011-09-23 09:46:24 +0200
commitdb87ed440c39f08800feb11a5e851674ab949c6b (patch)
treef139be5f44c251ed99b0d2a43afbd047d8d8f279 /sphinx/ext/oldcmarkup.py
parentfef4faf50d51009160a7947eebd877fb44f6f862 (diff)
downloadsphinx-git-db87ed440c39f08800feb11a5e851674ab949c6b.tar.gz
Fix #648: Fix line numbers reported in warnings about undefined references.
Diffstat (limited to 'sphinx/ext/oldcmarkup.py')
-rw-r--r--sphinx/ext/oldcmarkup.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/oldcmarkup.py b/sphinx/ext/oldcmarkup.py
index 2bf9b65d8..cfc95ba48 100644
--- a/sphinx/ext/oldcmarkup.py
+++ b/sphinx/ext/oldcmarkup.py
@@ -31,7 +31,7 @@ class OldCDirective(Directive):
def run(self):
env = self.state.document.settings.env
if not env.app._oldcmarkup_warned:
- env.warn(env.docname, WARNING_MSG, self.lineno)
+ self.state_machine.reporter.warning(WARNING_MSG, line=self.lineno)
env.app._oldcmarkup_warned = True
newname = 'c:' + self.name[1:]
newdir = env.lookup_domain_element('directive', newname)[0]
@@ -45,7 +45,7 @@ def old_crole(typ, rawtext, text, lineno, inliner, options={}, content=[]):
if not typ:
typ = env.config.default_role
if not env.app._oldcmarkup_warned:
- env.warn(env.docname, WARNING_MSG)
+ inliner.reporter.warning(WARNING_MSG, line=lineno)
env.app._oldcmarkup_warned = True
newtyp = 'c:' + typ[1:]
newrole = env.lookup_domain_element('role', newtyp)[0]