Skip to content

Commit

Permalink
Merge pull request NYUCCL#253 from jacob-lee/master
Browse files Browse the repository at this point in the history
The methods get_trial_data, get_question_data and get_eventdata were
not catching TypeError and ValueError exceptions as intended, causing data download in the psiturk shell to fail.

The list of exception classes needs to be enclosed in parentheses.
  • Loading branch information
deargle authored Jan 5, 2017
2 parents 388b22c + a391711 commit 3273512
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psiturk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __repr__(self):
def get_trial_data(self):
try:
trialdata = json.loads(self.datastring)["data"]
except TypeError, ValueError:
except (TypeError, ValueError):
# There was no data to return.
print("No trial data found in record:", self)
return("")
Expand All @@ -81,7 +81,7 @@ def get_trial_data(self):
def get_event_data(self):
try:
eventdata = json.loads(self.datastring)["eventdata"]
except ValueError, TypeError:
except (ValueError, TypeError):
# There was no data to return.
print("No event data found in record:", self)
return("")
Expand All @@ -101,7 +101,7 @@ def get_event_data(self):
def get_question_data(self):
try:
questiondata = json.loads(self.datastring)["questiondata"]
except TypeError, ValueError:
except (TypeError, ValueError):
# There was no data to return.
print("No question data found in record:", self)
return("")
Expand Down

0 comments on commit 3273512

Please sign in to comment.