Skip to content
Snippets Groups Projects
  • Thomas Schwinge's avatar
    eb4a3e6a
    Fix 'contrib/update-copyright.py': 'TypeError: exceptions must derive from BaseException' · eb4a3e6a
    Thomas Schwinge authored
    Running 'contrib/update-copyright.py' currently fails:
    
        [...]
        Traceback (most recent call last):
          File "contrib/update-copyright.py", line 365, in update_copyright
            canon_form = self.canonicalise_years (dir, filename, filter, years)
          File "contrib/update-copyright.py", line 270, in canonicalise_years
            (min_year, max_year) = self.year_range (years)
          File "contrib/update-copyright.py", line 253, in year_range
            year_list = [self.parse_year (year)
          File "contrib/update-copyright.py", line 253, in <listcomp>
            year_list = [self.parse_year (year)
          File "contrib/update-copyright.py", line 250, in parse_year
            raise self.BadYear (string)
        TypeError: exceptions must derive from BaseException
    
        During handling of the above exception, another exception occurred:
    
        Traceback (most recent call last):
          File "contrib/update-copyright.py", line 796, in <module>
            GCCCmdLine().main()
          File "contrib/update-copyright.py", line 527, in main
            self.copyright.process_tree (dir, filter)
          File "contrib/update-copyright.py", line 458, in process_tree
            self.process_file (dir, filename, filter)
          File "contrib/update-copyright.py", line 421, in process_file
            res = self.update_copyright (dir, filename, filter,
          File "contrib/update-copyright.py", line 366, in update_copyright
            except self.BadYear as e:
        TypeError: catching classes that do not inherit from BaseException is not allowed
    
    Fix up for commit 3b25e835
    "Port update-copyright.py to Python3".
    
    	contrib/
    	* update-copyright.py (class BadYear): Derive from 'Exception'.
    eb4a3e6a
    History
    Fix 'contrib/update-copyright.py': 'TypeError: exceptions must derive from BaseException'
    Thomas Schwinge authored
    Running 'contrib/update-copyright.py' currently fails:
    
        [...]
        Traceback (most recent call last):
          File "contrib/update-copyright.py", line 365, in update_copyright
            canon_form = self.canonicalise_years (dir, filename, filter, years)
          File "contrib/update-copyright.py", line 270, in canonicalise_years
            (min_year, max_year) = self.year_range (years)
          File "contrib/update-copyright.py", line 253, in year_range
            year_list = [self.parse_year (year)
          File "contrib/update-copyright.py", line 253, in <listcomp>
            year_list = [self.parse_year (year)
          File "contrib/update-copyright.py", line 250, in parse_year
            raise self.BadYear (string)
        TypeError: exceptions must derive from BaseException
    
        During handling of the above exception, another exception occurred:
    
        Traceback (most recent call last):
          File "contrib/update-copyright.py", line 796, in <module>
            GCCCmdLine().main()
          File "contrib/update-copyright.py", line 527, in main
            self.copyright.process_tree (dir, filter)
          File "contrib/update-copyright.py", line 458, in process_tree
            self.process_file (dir, filename, filter)
          File "contrib/update-copyright.py", line 421, in process_file
            res = self.update_copyright (dir, filename, filter,
          File "contrib/update-copyright.py", line 366, in update_copyright
            except self.BadYear as e:
        TypeError: catching classes that do not inherit from BaseException is not allowed
    
    Fix up for commit 3b25e835
    "Port update-copyright.py to Python3".
    
    	contrib/
    	* update-copyright.py (class BadYear): Derive from 'Exception'.