Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-12-15 19:25:47 +0300
committerJon Dufresne <jon.dufresne@gmail.com>2018-12-15 19:35:55 +0300
commitade973f4e376e6eb573be70fcce4f9b21faec500 (patch)
tree5d185c9a880e77db1e4a73131afaae90b1ad1c77 /sphinx/io.py
parent6113261948523ef6cad74621dec10e0cbf0189c7 (diff)
Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code. https://docs.python.org/3/library/functions.html#super
Diffstat (limited to 'sphinx/io.py')
-rw-r--r--sphinx/io.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/io.py b/sphinx/io.py
index d405081b1..1b326b804 100644
--- a/sphinx/io.py
+++ b/sphinx/io.py
@@ -65,18 +65,18 @@ class SphinxBaseReader(standalone.Reader):
def __init__(self, app, *args, **kwargs):
# type: (Sphinx, Any, Any) -> None
self.env = app.env
- super(SphinxBaseReader, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
def get_transforms(self):
# type: () -> List[Type[Transform]]
- return super(SphinxBaseReader, self).get_transforms() + self.transforms
+ return super().get_transforms() + self.transforms
def new_document(self):
# type: () -> nodes.document
"""Creates a new document object which having a special reporter object good
for logging.
"""
- document = super(SphinxBaseReader, self).new_document()
+ document = super().new_document()
# substitute transformer
document.transformer = SphinxTransformer(document)
@@ -104,7 +104,7 @@ class SphinxStandaloneReader(SphinxBaseReader):
def __init__(self, app, *args, **kwargs):
# type: (Sphinx, Any, Any) -> None
self.transforms = self.transforms + app.registry.get_transforms()
- super(SphinxStandaloneReader, self).__init__(app, *args, **kwargs)
+ super().__init__(app, *args, **kwargs)
class SphinxI18nReader(SphinxBaseReader):
@@ -166,7 +166,7 @@ class SphinxBaseFileInput(FileInput):
self.env = env
kwds['error_handler'] = 'sphinx' # py3: handle error on open.
- super(SphinxBaseFileInput, self).__init__(*args, **kwds)
+ super().__init__(*args, **kwds)
def read(self):
# type: () -> str
@@ -174,7 +174,7 @@ class SphinxBaseFileInput(FileInput):
After reading, it emits Sphinx event ``source-read``.
"""
- data = super(SphinxBaseFileInput, self).read()
+ data = super().read()
# emit source-read event
arg = [data]
@@ -237,7 +237,7 @@ class SphinxRSTFileInput(SphinxBaseFileInput):
warnings.warn('SphinxRSTFileInput is deprecated.',
RemovedInSphinx30Warning, stacklevel=2)
- inputstring = super(SphinxRSTFileInput, self).read()
+ inputstring = super().read()
lines = string2lines(inputstring, convert_whitespace=True)
content = StringList()
for lineno, line in enumerate(lines):