From aee704ebe19cb9baeecdda90b7f8f7551d59aa3b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 1 Nov 2015 00:38:12 +0300 Subject: extmod/modure: Make sure that errors in regexps are caught early. --- tests/extmod/ure1.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/extmod/ure1.py b/tests/extmod/ure1.py index 39e84d51e..aeadf4e5c 100644 --- a/tests/extmod/ure1.py +++ b/tests/extmod/ure1.py @@ -62,3 +62,8 @@ m = re.match('a*?', 'ab'); print(m.group(0)) m = re.match('^ab$', 'ab'); print(m.group(0)) m = re.match('a|b', 'b'); print(m.group(0)) m = re.match('a|b|c', 'c'); print(m.group(0)) + +try: + re.compile("*") +except: + print("Caught invalid regex") -- cgit v1.2.3