Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 18d191a

Browse files
committed
Fix pylint "no-else-raise"
1 parent a964172 commit 18d191a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/gluonnlp/embedding/token_embedding.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -724,10 +724,9 @@ def __setitem__(self, tokens, new_embedding):
724724
' unknown token, please explicitly include "{}" as the '
725725
'`unknown_token` in `tokens`. This is to avoid unintended '
726726
'updates.').format(token, self.unknown_token))
727-
else:
728-
raise KeyError(('Token "{}" is unknown. Updating the embedding vector for an '
729-
'unknown token is not allowed because `unknown_token` is not '
730-
'specified.').format(token))
727+
raise KeyError(('Token "{}" is unknown. Updating the embedding vector for an '
728+
'unknown token is not allowed because `unknown_token` is not '
729+
'specified.').format(token))
731730

732731
self._idx_to_vec[nd.array(indices)] = new_embedding
733732

0 commit comments

Comments
 (0)