Skip to content

Commit

Permalink
FileLocation: Correct exception class usage in comparison operators.
Browse files Browse the repository at this point in the history
Use TypeError now (was: AttributeError).
  • Loading branch information
jenisys committed Nov 2, 2016
1 parent d518fc4 commit 0e19c85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions behave/model_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def __eq__(self, other):
elif isinstance(other, six.string_types):
return self.filename == other
else:
raise AttributeError("Cannot compare FileLocation with %s:%s" % \
(type(other), other))
raise TypeError("Cannot compare FileLocation with %s:%s" % \
(type(other), other))

def __ne__(self, other):
# return not self == other # pylint: disable=unneeded-not
Expand All @@ -203,8 +203,8 @@ def __lt__(self, other):
elif isinstance(other, six.string_types):
return self.filename < other
else:
raise AttributeError("Cannot compare FileLocation with %s:%s" % \
(type(other), other))
raise TypeError("Cannot compare FileLocation with %s:%s" % \
(type(other), other))

def __le__(self, other):
# -- SEE ALSO: python2.7, functools.total_ordering
Expand Down

0 comments on commit 0e19c85

Please sign in to comment.