Skip to content

Commit

Permalink
Allow Exceptions to be NoneScore scores
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerkin committed Nov 7, 2017
1 parent f1dbfa7 commit 241de5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sciunit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,10 @@ class NoneScore(Score):
checked to see if it has the capabilities required by the test."""

def __init__(self, score, related_data=None):
if isinstance(score,str) or score is None:
if isinstance(score,(Exception,str)) or score is None:
super(NoneScore,self).__init__(score, related_data=related_data)
else:
raise InvalidScoreError(("Score must an (e.g. exception) string "
"or None."))
raise InvalidScoreError("Score must be an Exception, a string, or None")

@property
def sort_key(self):
Expand Down

0 comments on commit 241de5d

Please sign in to comment.