[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.49,2.50 sre_constants.h,2.10,2.11

Fredrik Lundh python-dev@python.org
Mon, 15 Jan 2001 04:46:11 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv15616/Modules

Modified Files:
	_sre.c sre_constants.h 
Log Message:


added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches


Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -r2.49 -r2.50
*** _sre.c	2001/01/14 23:55:55	2.49
--- _sre.c	2001/01/15 12:46:09	2.50
***************
*** 2356,2364 ****
  init_sre(void)
  {
      /* Patch object types */
      Pattern_Type.ob_type = Match_Type.ob_type =
          Scanner_Type.ob_type = &PyType_Type;
  
!     Py_InitModule("_" MODULE, _functions);
  }
  
--- 2356,2372 ----
  init_sre(void)
  {
+     PyObject* m;
+     PyObject* d;
+ 
      /* Patch object types */
      Pattern_Type.ob_type = Match_Type.ob_type =
          Scanner_Type.ob_type = &PyType_Type;
+ 
+     m = Py_InitModule("_" MODULE, _functions);
+     d = PyModule_GetDict(m);
  
!     PyDict_SetItemString(
!         d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
!         );
  }
  

Index: sre_constants.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/sre_constants.h,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -r2.10 -r2.11
*** sre_constants.h	2001/01/14 15:06:11	2.10
--- sre_constants.h	2001/01/15 12:46:09	2.11
***************
*** 12,15 ****
--- 12,16 ----
   */
  
+ #define SRE_MAGIC 20010115
  #define SRE_OP_FAILURE 0
  #define SRE_OP_SUCCESS 1