comparison roundup/rest.py @ 5644:b4d7588c74a4

Make exception raising work on python 3.
author John Rouillard <rouilj@ieee.org>
date Sun, 10 Mar 2019 17:57:26 -0400
parents a60cbbcc9309
children d791c5ba5852
comparison
equal deleted inserted replaced
5643:a60cbbcc9309 5644:b4d7588c74a4
1437 1437
1438 ''' 1438 '''
1439 def __init__(self, json_string): 1439 def __init__(self, json_string):
1440 ''' Parse the json string into an internal dict. ''' 1440 ''' Parse the json string into an internal dict. '''
1441 def raise_error_on_constant(x): 1441 def raise_error_on_constant(x):
1442 raise ValueError, "Unacceptable number: %s"%x 1442 raise ValueError("Unacceptable number: %s"%x)
1443 1443
1444 self.json_dict = json.loads(json_string, 1444 self.json_dict = json.loads(json_string,
1445 parse_constant = raise_error_on_constant) 1445 parse_constant = raise_error_on_constant)
1446 self.value = [ self.FsValue(index, self.json_dict[index]) for index in self.json_dict.keys() ] 1446 self.value = [ self.FsValue(index, self.json_dict[index]) for index in self.json_dict.keys() ]
1447 1447

Roundup Issue Tracker: http://roundup-tracker.org/