Py3k always sets re.U flag, so the resulting regex.flags are equals to flags | re.U.

This commit is contained in:
Przemyslaw Gajda 2012-04-23 10:21:50 +02:00
parent 48a9b76403
commit 79375ce4d5
1 changed files with 3 additions and 3 deletions

6
mox.py
View File

@ -1439,7 +1439,7 @@ class Regex(Comparator):
# flags passed to re.compile function as the second argument
flags: int
"""
self.flags = flags
self.regex = re.compile(pattern, flags=flags)
def equals(self, rhs):
@ -1456,8 +1456,8 @@ class Regex(Comparator):
def __repr__(self):
s = '<regular expression \'%s\'' % self.regex.pattern
if self.regex.flags:
s += ', flags=%d' % self.regex.flags
if self.flags:
s += ', flags=%d' % self.flags
s += '>'
return s