Skip to content

Commit

Permalink
Merge pull request datacarpentry#268 from maxim-belkin/fix-returns
Browse files Browse the repository at this point in the history
util.py: make functions return NotImplemented
  • Loading branch information
rgaiacs authored May 23, 2018
2 parents 894d47f + dd1fce0 commit 961f24a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def pretty(item):
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):
Expand All @@ -86,8 +87,9 @@ def key(item):
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."""
Expand Down

0 comments on commit 961f24a

Please sign in to comment.