Skip to content

Commit

Permalink
All classes are new-style in Python 3
Browse files Browse the repository at this point in the history
We no longer need to explictly inherit
from the 'object' class.
  • Loading branch information
benmwebb committed Aug 9, 2024
1 parent f639fff commit bd9b2e4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tools/build/doxygen_add_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_page_from_source(source, id_re, id_to_page):
raise ValueError("Cannot find page id in %s" % source)


class Page(object):
class Page:
"""Representation of a single page in the documentation"""
def __init__(self, id):
self.id = id
Expand Down Expand Up @@ -148,7 +148,7 @@ def github_edit(self):
% (root, os.path.sep.join(sp)))


class Docs(object):
class Docs:
"""Representation of all doxygen documentation"""

def __init__(self, xml_dir, html_dir, top_source_dir, source_subdirs):
Expand Down
2 changes: 1 addition & 1 deletion tools/build/doxygen_filter_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def handle_class(c, indent, printer):
dump_class(c, meths, indent, printer)


class OutputPrinter(object):
class OutputPrinter:

def __init__(self):
# The number of the next line to be written (1-based)
Expand Down
2 changes: 1 addition & 1 deletion tools/build/doxygen_spell_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _skip(self, word):
or self._pattern.match(word) is not None


class SpellChecker(object):
class SpellChecker:
def __init__(self, exceptions_file):
self.chkr = enchant.checker.SpellChecker(
"en_US", filters=[EmailFilter, URLFilter, IMPNameFilter])
Expand Down
2 changes: 1 addition & 1 deletion tools/build/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def link_swig(modules):

# Don't link __init__.py from the top-level of any module (it is generated
# either by SWIG or by make_python_init.py)
class _ExcludeTopLevelPythonInit(object):
class _ExcludeTopLevelPythonInit:
def __init__(self, topdir):
self.pyinit = os.path.join(topdir, '__init__.py')

Expand Down
2 changes: 1 addition & 1 deletion tools/build/setup_imppy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def uniq(ls):
yield obj


class FileGenerator(object):
class FileGenerator:
body = ["@LDPATH@", "", "@PYTHONPATH@", "",
"# Where to find data for the various modules",
"@IMP_DATA@", "",
Expand Down
6 changes: 3 additions & 3 deletions tools/build/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def rewrite(filename, contents, verbose=True):
fh.write(contents)


class FileGenerator(object):
class FileGenerator:
"""Auto-generate an output file.
The file is marked as being auto-generated with a suitable comment.
`template_file` names an input file containing a suitable template
Expand Down Expand Up @@ -272,7 +272,7 @@ def link_dir(source_dir, target_dir, match=["*"], exclude=[],
os.unlink(ln)


class Module(object):
class Module:
"""An IMP module"""
_info = None

Expand Down Expand Up @@ -412,7 +412,7 @@ def _read_dep_file(self, attr):
python_only = property(lambda self: self._read_dep_file('python_only'))


class ModulesFinder(object):
class ModulesFinder:
"""Class for finding IMP modules.
Acts like a dict with module names as keys and Module objects as values.
Expand Down

0 comments on commit bd9b2e4

Please sign in to comment.