diff options
Diffstat (limited to 'rpython')
-rw-r--r-- | rpython/rlib/rsre/rsre_utf8.py | 5 | ||||
-rw-r--r-- | rpython/rlib/rsre/test/support.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/rpython/rlib/rsre/rsre_utf8.py b/rpython/rlib/rsre/rsre_utf8.py index aaac302ac0..7617acc5fd 100644 --- a/rpython/rlib/rsre/rsre_utf8.py +++ b/rpython/rlib/rsre/rsre_utf8.py @@ -93,10 +93,11 @@ def utf8match(pattern, utf8string, bytestart=0, byteend=sys.maxint, fullmatch=False): # bytestart and byteend must be valid byte positions inside the # utf8string. - from rpython.rlib.rsre.rsre_core import match_context + from rpython.rlib.rsre.rsre_core import match_context, MODE_FULL ctx = make_utf8_ctx(utf8string, bytestart, byteend) - ctx.fullmatch_only = fullmatch + if fullmatch: + ctx.match_mode = MODE_FULL if match_context(ctx, pattern): return ctx else: diff --git a/rpython/rlib/rsre/test/support.py b/rpython/rlib/rsre/test/support.py index 9e8fafc7c1..4e12277bcb 100644 --- a/rpython/rlib/rsre/test/support.py +++ b/rpython/rlib/rsre/test/support.py @@ -1,6 +1,7 @@ import sys, random from rpython.rlib import debug from rpython.rlib.rsre.rsre_core import _adjust, match_context, search_context +from rpython.rlib.rsre.rsre_core import MODE_FULL from rpython.rlib.rsre.rsre_core import StrMatchContext, EndOfString @@ -112,7 +113,8 @@ def match(pattern, string, start=0, end=sys.maxint, fullmatch=False): start = Position(start) end = Position(end) ctx = MatchContextForTests(string, start, end) - ctx.fullmatch_only = fullmatch + if fullmatch: + ctx.match_mode = MODE_FULL if match_context(ctx, pattern): return ctx else: |