From 10b1a2fba259fae1179ab36e9df88c59beea7bfb Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 12 Dec 2018 21:48:06 +0900 Subject: [PATCH] refactor SphinxSmartQuotes: Override smartquotes_action by str value (instaed of property) --- sphinx/transforms/__init__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py index 387dd70bd..3052ac38a 100644 --- a/sphinx/transforms/__init__.py +++ b/sphinx/transforms/__init__.py @@ -353,6 +353,9 @@ class SphinxSmartQuotes(SmartQuotes, SphinxTransform): if not self.is_available(): return + # override default settings with :confval:`smartquotes_action` + self.smartquotes_action = self.config.smartquotes_action + super(SphinxSmartQuotes, self).apply() def is_available(self): @@ -381,15 +384,6 @@ class SphinxSmartQuotes(SmartQuotes, SphinxTransform): else: return False - @property - def smartquotes_action(self): - # type: () -> str - """A smartquotes_action setting for SmartQuotes. - - Users can change this setting through :confval:`smartquotes_action`. - """ - return self.config.smartquotes_action - def get_tokens(self, txtnodes): # type: (List[nodes.Text]) -> Generator[Tuple[unicode, unicode], None, None] # A generator that yields ``(texttype, nodetext)`` tuples for a list