diff --git a/breathe/apidoc.py b/breathe/apidoc.py index e7ff33eb..19896680 100644 --- a/breathe/apidoc.py +++ b/breathe/apidoc.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ breathe.apidoc ~~~~~~~~~~~~~~ @@ -14,7 +13,6 @@ :copyright: Originally by Sphinx Team, C++ modifications by Tatsuyuki Ishi :license: BSD, see LICENSE for details. """ -from __future__ import print_function import os import sys @@ -24,14 +22,6 @@ from breathe import __version__ -# Account for FileNotFoundError in Python 2 -# IOError is broader but will hopefully suffice -try: - FileNotFoundError -except NameError: - FileNotFoundError = IOError - - # Reference: Doxygen XSD schema file, CompoundKind only # Only what breathe supports are included # Translates identifier to English @@ -71,7 +61,7 @@ def write_file(name, text, args): if exc.errno != errno.EEXIST: raise try: - with open(fname, "r") as target: + with open(fname) as target: orig = target.read() if orig == text: print_info("File %s up to date, skipping." % fname, args) @@ -141,7 +131,7 @@ def recurse_tree(args): class TypeAction(argparse.Action): def __init__(self, option_strings, dest, **kwargs): - super(TypeAction, self).__init__(option_strings, dest, **kwargs) + super().__init__(option_strings, dest, **kwargs) self.default = TYPEDICT.keys() self.metavar = ",".join(TYPEDICT.keys()) diff --git a/breathe/parser/compound.py b/breathe/parser/compound.py index da6ee69b..cf858d7d 100644 --- a/breathe/parser/compound.py +++ b/breathe/parser/compound.py @@ -927,7 +927,7 @@ def __init__(self, char=None, valueOf_=''): # end class docCharTypeSub -class verbatimTypeSub(object): +class verbatimTypeSub: """ New node type. Structure is largely pillaged from other nodes in order to match the set. @@ -1200,7 +1200,7 @@ def parse(inFilename): try: doc = minidom.parse(inFilename) - except IOError as e: + except OSError as e: raise FileIOError(e) except ExpatError as e: raise ParseError(e) diff --git a/breathe/parser/compoundsuper.py b/breathe/parser/compoundsuper.py index 79050edd..3c01da9c 100644 --- a/breathe/parser/compoundsuper.py +++ b/breathe/parser/compoundsuper.py @@ -134,7 +134,7 @@ def getName(self): return self.name -class _MemberSpec(object): +class _MemberSpec: def __init__(self, name='', data_type='', container=0): self.name = name self.data_type = data_type @@ -2632,7 +2632,7 @@ def buildChildren(self, child_, nodeName_): value_.append(text_.nodeValue) # We make this unicode so that our unicode renderer catch-all picks it up # otherwise it would go through as 'str' and we'd have to pick it up too - valuestr_ = u' ' + valuestr_ = ' ' obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'sp', valuestr_) self.content_.append(obj_) diff --git a/breathe/parser/index.py b/breathe/parser/index.py index 3788991e..d4f0634b 100644 --- a/breathe/parser/index.py +++ b/breathe/parser/index.py @@ -49,7 +49,7 @@ class FileIOError(Exception): def parse(inFilename): try: doc = minidom.parse(inFilename) - except IOError as e: + except OSError as e: raise FileIOError(e) except ExpatError as e: raise ParseError(e) diff --git a/breathe/parser/indexsuper.py b/breathe/parser/indexsuper.py index 4c7126ce..8f748455 100644 --- a/breathe/parser/indexsuper.py +++ b/breathe/parser/indexsuper.py @@ -129,7 +129,7 @@ def getName(self): return self.name -class _MemberSpec(object): +class _MemberSpec: def __init__(self, name='', data_type='', container=0): self.name = name self.data_type = data_type diff --git a/tests/warnings/source/conf.py b/tests/warnings/source/conf.py index 3dfc126d..3b63231f 100644 --- a/tests/warnings/source/conf.py +++ b/tests/warnings/source/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Test Breathe Warnings documentation build configuration file, created by # sphinx-quickstart on Thu Jun 5 18:57:21 2014.