mirror of
https://github.com/google/re2.git
synced 2025-10-19 19:44:44 +08:00
Raise re2.error
instead of crashing.
Fixes #484. Change-Id: I152b5ed8a6358d2d74f553bde2e66f2e50cfba1d Reviewed-on: https://code-review.googlesource.com/c/re2/+/62890 Reviewed-by: Alex Chernyakhovsky <achernya@google.com> Reviewed-by: Paul Wankadia <junyer@google.com>
This commit is contained in:
@@ -33,8 +33,9 @@ import itertools
|
||||
import _re2
|
||||
|
||||
|
||||
class error(Exception):
|
||||
pass
|
||||
# pybind11 translates C++ exceptions to Python exceptions.
|
||||
# We use that same Python exception class for consistency.
|
||||
error = _re2.Error
|
||||
|
||||
|
||||
class Options(_re2.RE2.Options):
|
||||
|
Reference in New Issue
Block a user