Skip to content

Commit dd19193

Browse files
authored
Merge pull request #211 from bsipocz/MAINT_minor_cleanup
MAINT: minor updates
2 parents dceb4e5 + 208efd0 commit dd19193

File tree

14 files changed

+16
-20
lines changed

14 files changed

+16
-20
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32
#
43
# -- General configuration ------------------------------------------------
54
from sphinx_automodapi import __version__

sphinx_automodapi/automodapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
324324

325325
# add automodule directive only if no-main-docstr isn't present
326326
if maindocstr:
327-
automodline = '.. automodule:: {modname}'.format(modname=modnm)
327+
automodline = f'.. automodule:: {modnm}'
328328
else:
329329
automodline = ''
330330
if top_head:
@@ -409,7 +409,7 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
409409
if docname is None:
410410
with open(os.path.join(app.srcdir, 'unknown.automodapi'),
411411
'a', encoding='utf8') as f:
412-
f.write(u'\n**NEW DOC**\n\n')
412+
f.write('\n**NEW DOC**\n\n')
413413
f.write(ustr)
414414
else:
415415
env = app.builder.env

sphinx_automodapi/automodsumm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',
535535
try:
536536
import_by_name_values = import_by_name(name)
537537
except ImportError as e:
538-
logger.warning('[automodsumm] failed to import %r: %s' % (name, e))
538+
logger.warning('[automodsumm] failed to import {!r}: {}'.format(name, e))
539539
continue
540540

541541
# if block to accommodate Sphinx's v1.2.2 and v1.2.3 respectively

sphinx_automodapi/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def pilot():
2727
test_pkg.join('setup.py').write(dedent("""\
2828
import sys
2929
30-
sys.path.insert(0, {0!r})
30+
sys.path.insert(0, {!r})
3131
3232
from os.path import join
3333
from setuptools import setup, Extension

sphinx_automodapi/tests/example_module/attribute_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class ClassWithAttribute(object):
1+
class ClassWithAttribute:
22
"""A class with an attribute."""
33
my_attribute = 1
44

sphinx_automodapi/tests/example_module/classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__all__ = ['Spam', 'Egg']
22

33

4-
class BaseSpam(object):
4+
class BaseSpam:
55
"""
66
Base class for Spam
77
"""
@@ -26,7 +26,7 @@ class Spam(BaseSpam):
2626
pass
2727

2828

29-
class Egg(object):
29+
class Egg:
3030
"""
3131
An egg (no inheritance)
3232
"""

sphinx_automodapi/tests/example_module/mixed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def add(a, b):
1212
return a + b
1313

1414

15-
class MixedSpam(object):
15+
class MixedSpam:
1616
"""
1717
Special spam
1818
"""

sphinx_automodapi/tests/example_module/nonascii.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__all__ = ['NonAsciiÄöüßő']
22

33

4-
class NonAsciiÄöüßő(object):
4+
class NonAsciiÄöüßő:
55
def get_äöü(self):
66
"""
77
Return a string with common umlauts like äöüß

sphinx_automodapi/tests/example_module/other_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__all__ = ['Foo']
22

33

4-
class BaseFoo(object):
4+
class BaseFoo:
55
"""
66
Base class for Foo
77
"""

sphinx_automodapi/tests/example_module/slots.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
__all__ = ['SlotDict', 'DerivedParam', 'DerivedSlotParam',]
1313

1414

15-
class SlotDict(object):
15+
class SlotDict:
1616
"""
1717
A class that uses __slots__ and __dict__ for its attribute namespace.
1818
"""
@@ -72,7 +72,7 @@ def __init__(self, param: str, other_param: str, extra_param: str):
7272
extra_param : str
7373
An extra parameter
7474
"""
75-
super(DerivedParam, self).__init__(param, other_param)
75+
super().__init__(param, other_param)
7676
self.extra_attr = extra_param
7777

7878
def derived_from_slot_class_method(self):
@@ -104,7 +104,7 @@ def __init__(self, param: str, other_param: str, extra_param: str):
104104
extra_param : str
105105
An extra parameter
106106
"""
107-
super(DerivedSlotParam, self).__init__(param, other_param)
107+
super().__init__(param, other_param)
108108
self.extra_attr = extra_param
109109

110110
def derived_from_slot_class_method(self):

0 commit comments

Comments
 (0)