[Python-checkins] CVS: python/dist/src/Lib sre.py,1.3,1.4

Guido van Rossum python-dev@python.org
Tue, 2 May 2000 11:52:36 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/Lib
In directory eric:/projects/python/develop/guido/src/Lib
Modified Files:
	sre.py 
Log Message:
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.
Index: sre.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/sre.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** sre.py	2000年04月10日 17:10:48	1.3
--- sre.py	2000年05月02日 15:52:33	1.4
***************
*** 2,6 ****
 #
 # Secret Labs' Regular Expression Engine
! # $Id: sre.py,v 1.3 2000年04月10日 17:10:48 guido Exp $
 #
 # re-compatible interface for the sre matching engine
--- 2,6 ----
 #
 # Secret Labs' Regular Expression Engine
! # $Id: sre.py,v 1.4 2000年05月02日 15:52:33 guido Exp $
 #
 # re-compatible interface for the sre matching engine
***************
*** 32,36 ****
 
 def search(pattern, string, flags=0):
- assert flags == 0
 return compile(pattern, _fixflags(flags)).search(string)
 
--- 32,35 ----
***************
*** 42,46 ****
 def _fixflags(flags):
 # convert flag bitmask to sequence
! assert flags == 0
 return ()
 
--- 41,45 ----
 def _fixflags(flags):
 # convert flag bitmask to sequence
! assert not flags
 return ()
 

AltStyle によって変換されたページ (->オリジナル) /