Merge pull request #269 from maxim-belkin/fix-super-call
[rnaseq-cwl-training.git] / bin / util.py
index 5bc7e9ba8418187b74f9fe452e5ce7aca7fc88bd..e1a03a21084240a4f1af7e741fee58eec3ac116d 100644 (file)
@@ -30,13 +30,11 @@ UNWANTED_FILES = [
 REPORTER_NOT_SET = []
 
 
-class Reporter(object):
+class Reporter:
     """Collect and report errors."""
 
     def __init__(self):
         """Constructor."""
-
-        super(Reporter, self).__init__()
         self.messages = []
 
     def check_field(self, filename, name, values, key, expected=REPORTER_NOT_SET):
@@ -74,8 +72,9 @@ class Reporter(object):
             return location + ': ' + message
         elif isinstance(location, tuple):
             return '{0}:{1}: '.format(*location) + message
-        else:
-            assert False, 'Unknown item "{0}"'.format(item)
+
+        print('Unknown item "{0}"'.format(item), file=sys.stderr)
+        return NotImplemented
 
     @staticmethod
     def key(item):
@@ -86,8 +85,9 @@ class Reporter(object):
             return (location, -1, message)
         elif isinstance(location, tuple):
             return (location[0], location[1], message)
-        else:
-            assert False, 'Unknown item "{0}"'.format(item)
+
+        print('Unknown item "{0}"'.format(item), file=sys.stderr)
+        return NotImplemented
 
     def report(self, stream=sys.stdout):
         """Report all messages in order."""