Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b6aecb

Browse files
committed
I know this is only a temporary stop-gap measure, but the match() and
search() functions didn't even work because _fixflags() isn't idempotent. I'm adding another stop-gap measure so that you can at least use sre.search() and sre.match() with a zero flags arg.
1 parent 823eb4b commit 1b6aecb

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/sre.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def match(pattern, string, flags=0):
3131
return compile(pattern, _fixflags(flags)).match(string)
3232

3333
def search(pattern, string, flags=0):
34-
assert flags == 0
3534
return compile(pattern, _fixflags(flags)).search(string)
3635

3736
# FIXME: etc
@@ -41,6 +40,6 @@ def search(pattern, string, flags=0):
4140

4241
def _fixflags(flags):
4342
# convert flag bitmask to sequence
44-
assert flags == 0
43+
assert not flags
4544
return ()
4645

0 commit comments

Comments
 (0)