FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-35293: Remove RemovedInSphinx40Warning by corona10 · Pull Request #22198 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
36 changes: 21 additions & 15 deletions Doc/tools/extensions/pyspecific.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
from sphinx.writers.latex import LaTeXTranslator
from sphinx.domains.python import PyModulelevel, PyClassmember

try:
from sphinx.domains.python import PyFunction, PyMethod
except ImportError:
from sphinx.domains.python import PyClassmember as PyMethod
from sphinx.domains.python import PyModulelevel as PyFunction
Comment thread
vstinner marked this conversation as resolved.

# Support for checking for suspicious markup

Expand Down Expand Up @@ -271,17 +276,18 @@ def needs_arglist(self):
return False


class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel):
class PyDecoratorFunction(PyDecoratorMixin, PyFunction):
def run(self):
# a decorator function is a function after all
self.name = 'py:function'
return PyModulelevel.run(self)
return PyFunction.run(self)


class PyDecoratorMethod(PyDecoratorMixin, PyClassmember):
# TODO: Use sphinx.domains.python.PyDecoratorMethod when possible
class PyDecoratorMethod(PyDecoratorMixin, PyMethod):
def run(self):
self.name = 'py:method'
return PyClassmember.run(self)
return PyMethod.run(self)


class PyCoroutineMixin(object):
Expand All @@ -298,31 +304,31 @@ def handle_signature(self, sig, signode):
return ret


class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel):
class PyCoroutineFunction(PyCoroutineMixin, PyFunction):
def run(self):
self.name = 'py:function'
return PyModulelevel.run(self)
return PyFunction.run(self)


class PyCoroutineMethod(PyCoroutineMixin, PyClassmember):
class PyCoroutineMethod(PyCoroutineMixin, PyMethod):
def run(self):
self.name = 'py:method'
return PyClassmember.run(self)
return PyMethod.run(self)


class PyAwaitableFunction(PyAwaitableMixin, PyClassmember):
class PyAwaitableFunction(PyAwaitableMixin, PyFunction):
def run(self):
self.name = 'py:function'
return PyClassmember.run(self)
return PyFunction.run(self)


class PyAwaitableMethod(PyAwaitableMixin, PyClassmember):
class PyAwaitableMethod(PyAwaitableMixin, PyMethod):
def run(self):
self.name = 'py:method'
return PyClassmember.run(self)
return PyMethod.run(self)


class PyAbstractMethod(PyClassmember):
class PyAbstractMethod(PyMethod):

def handle_signature(self, sig, signode):
ret = super(PyAbstractMethod, self).handle_signature(sig, signode)
Expand All @@ -332,7 +338,7 @@ def handle_signature(self, sig, signode):

def run(self):
self.name = 'py:method'
return PyClassmember.run(self)
return PyMethod.run(self)


# Support for documenting version of removal in deprecations
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix RemovedInSphinx40Warning when building the documentation. Patch by Dong-hee Na.

Back | FazBrowse Home | New Git URL