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

Fredrik Lundh effbot@users.sourceforge.net
Tue, 18 Sep 2001 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);
+     }
  }