Skip to content

Commit 969ce46

Browse files
committed
Make failing tests pass again
1 parent 4df3926 commit 969ce46

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

basest/core/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
absolute_import, division, print_function, unicode_literals
55
)
66

7+
from ..exceptions import InvalidSymbolTableError
8+
79

810
def ints_to_symbols(ints, symbol_table):
911
"""
@@ -39,12 +41,12 @@ def validate_symbol_tables(symbol_table, padding_symbol, other_symbol_table):
3941
"""
4042
Validates two symbol tables (the padding symbol being used alongside the
4143
first one).
42-
Raises ValueError if either of the symbol tables (or padding symbol) fail
43-
validation.
44+
Raises InvalidSymbolTableError if either of the symbol tables (or padding
45+
symbol) fail validation.
4446
"""
4547
# first check that they all do not contain None
4648
if None in (symbol_table + [padding_symbol] + other_symbol_table):
47-
raise ValueError(
49+
raise InvalidSymbolTableError(
4850
'None cannot be used in symbol tables nor for padding'
4951
)
5052
# if that check passes, validate tables (and padding) for uniqueness
@@ -53,4 +55,4 @@ def validate_symbol_tables(symbol_table, padding_symbol, other_symbol_table):
5355
(not _symbol_table_is_unique(symbol_table, padding_symbol)) or
5456
(not _symbol_table_is_unique(other_symbol_table))
5557
):
56-
raise ValueError('Unique symbol tables required')
58+
raise InvalidSymbolTableError('Unique symbol tables required')

0 commit comments

Comments
 (0)