Skip to content

Commit

Permalink
Fix lint in data_types.py
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Jul 18, 2023
1 parent 5005de0 commit f5192ce
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions stone/ir/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def set_default(self, default):
@property
def default(self):
if not self.has_default:
raise Exception('Type has no default')
raise ValueError('Type has no default')
else:
return self._default

Expand Down Expand Up @@ -1382,7 +1382,7 @@ def __init__(self, name, namespace, ast_node, closed):

# TODO: Why is this a different signature than the parent? Is this
# intentional?
def set_attributes(self, doc, fields, # pylint: disable=arguments-differ
def set_attributes(self, doc, fields,
parent_type=None, catch_all_field=None):
"""
:param UnionField catch_all_field: The field designated as the
Expand Down Expand Up @@ -1475,7 +1475,6 @@ def _add_example(self, example):
)

# TODO: are we always guaranteed at least one field?
# pylint: disable=undefined-loop-variable
try:
field.data_type.check_example(example_field)
except InvalidSpec as e:
Expand Down Expand Up @@ -1581,7 +1580,6 @@ def get_json_val(dt, val):
raise AssertionError('No example for label %r' % label)

# TODO: are we always guaranteed at least one field?
# pylint: disable=undefined-loop-variable
assert is_void_type(field.data_type)
return Example(
field.name, field.doc, OrderedDict([('.tag', field.name)]))
Expand Down

0 comments on commit f5192ce

Please sign in to comment.