summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-07 18:49:14 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-07 18:49:14 +0900
commit8b5686d87c2b1729cd6f84810400ca7bdf800ebc (patch)
treebe7747fb5a7c654c59997851439de71d24b7b5f3
parent0e89979355c6c88adb960a7272c633d5afd34e67 (diff)
downloadsphinx-git-8b5686d87c2b1729cd6f84810400ca7bdf800ebc.tar.gz
Fix #7267: autodoc: errormsg for invalid directive options has wrong location
-rw-r--r--CHANGES1
-rw-r--r--sphinx/ext/autodoc/directive.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 15c4f376c..a9f109061 100644
--- a/CHANGES
+++ b/CHANGES
@@ -91,6 +91,7 @@ Bugs fixed
* C++, suppress warnings for directly dependent typenames in cross references
generated automatically in signatures.
* #5637: autodoc: Incorrect handling of nested class names on show-inheritance
+* #7267: autodoc: error message for invalid directive options has wrong location
* #5637: inheritance_diagram: Incorrect handling of nested class names
* #7139: ``code-block:: guess`` does not work
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py
index b44bd75b3..9302a954a 100644
--- a/sphinx/ext/autodoc/directive.py
+++ b/sphinx/ext/autodoc/directive.py
@@ -137,7 +137,7 @@ class AutodocDirective(SphinxDirective):
except (KeyError, ValueError, TypeError) as exc:
# an option is either unknown or has a wrong type
logger.error('An option to %s is either unknown or has an invalid value: %s' %
- (self.name, exc), location=(source, lineno))
+ (self.name, exc), location=(self.env.docname, lineno))
return []
# generate the output