Skip to content

Commit 5540c1d

Browse files
committed
Throw exception instead of assert
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent a7d75d4 commit 5540c1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bpython/repl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,14 @@ def update(self, cursor_offset, current_line, matches, completer):
245245
"""Called to reset the match index and update the word being replaced
246246
247247
Should only be called if there's a target to update - otherwise, call clear"""
248+
249+
if matches is None:
250+
raise ValueError("Matches may not be None.")
251+
248252
self.orig_cursor_offset = cursor_offset
249253
self.orig_line = current_line
250-
assert matches is not None
251254
self.matches = matches
252255
self.completer = completer
253-
#assert self.completer.locate(self.orig_cursor_offset, self.orig_line) is not None, (self.completer.locate, self.orig_cursor_offset, self.orig_line)
254256
self.index = -1
255257
self.start, self.end, self.current_word = self.completer.locate(self.orig_cursor_offset, self.orig_line)
256258

0 commit comments

Comments
 (0)