[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.64,2.65

Fredrik Lundh effbot@users.sourceforge.net
2001年9月18日 11:47:11 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv30976/Modules
Modified Files:
	_sre.c 
Log Message:
an SRE bugfix a day keeps Guido away...
#462270: sub-tle difference between pre.sub and sre.sub. PRE ignored
an empty match at the previous location, SRE didn't.
also synced with Secret Labs "sreopen" codebase.
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.64
retrieving revision 2.65
diff -C2 -d -r2.64 -r2.65
*** _sre.c	2001年08月30日 14:37:07	2.64
--- _sre.c	2001年09月18日 18:47:09	2.65
***************
*** 32,35 ****
--- 32,36 ----
 * 2001年05月14日 fl fixes for 1.5.2
 * 2001年07月01日 fl added BIGCHARSET support (from Martin von Loewis)
+ * 2001年09月18日 fl 
 *
 * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
***************
*** 134,137 ****
--- 135,140 ----
 #define SRE_WORD_MASK 16
 
+ /* FIXME: this assumes ASCII. create tables in init_sre() instead */
+ 
 static char sre_char_info[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 2,
 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
***************
*** 1142,1145 ****
--- 1145,1149 ----
 
 /* can't end up here */
+ /* return SRE_ERROR_ILLEGAL; -- see python-dev discussion */
 }
 
***************
*** 2624,2638 ****
 m = Py_InitModule("_" SRE_MODULE, _functions);
 d = PyModule_GetDict(m);
- 
- PyDict_SetItemString(
- d, "MAGIC", (x = (PyObject*) PyInt_FromLong(SRE_MAGIC))
- );
- Py_XDECREF(x);
 
! PyDict_SetItemString(
! 	d, "copyright", (x = (PyObject*)PyString_FromString(copyright))
! );
! Py_XDECREF(x);
 
 }
 
--- 2628,2643 ----
 m = Py_InitModule("_" SRE_MODULE, _functions);
 d = PyModule_GetDict(m);
 
! x = PyInt_FromLong(SRE_MAGIC);
! if (x) {
! PyDict_SetItemString(d, "MAGIC", x);
! Py_DECREF(x);
! }
 
+ x = PyString_FromString(copyright);
+ if (x) {
+ PyDict_SetItemString(d, "copyright", x);
+ Py_DECREF(x);
+ }
 }
 

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