[Python-checkins] CVS: python/dist/src/Lib sre_compile.py,1.32,1.33 sre_constants.py,1.22,1.23

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


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

Modified Files:
	sre_compile.py sre_constants.py 
Log Message:


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


Index: sre_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_compile.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** sre_compile.py	2001/01/14 15:06:11	1.32
--- sre_compile.py	2001/01/15 12:46:09	1.33
***************
*** 13,16 ****
--- 13,18 ----
  from sre_constants import *
  
+ assert _sre.MAGIC == MAGIC, "SRE module mismatch"
+ 
  MAXCODE = 65535
  

Index: sre_constants.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_constants.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** sre_constants.py	2001/01/14 15:06:11	1.22
--- sre_constants.py	2001/01/15 12:46:09	1.23
***************
*** 10,15 ****
--- 10,22 ----
  #
  
+ # update when constants are added or removed
+ 
+ MAGIC = 20010115
+ 
+ # max code word in this release
+ 
  MAXREPEAT = 65535
  
+ # SRE standard exception (access as sre.error)
  # should this really be here?
  
***************
*** 211,214 ****
--- 218,223 ----
  
  """)
+ 
+     f.write("#define SRE_MAGIC %d\n" % MAGIC)
  
      dump(f, OPCODES, "SRE_OP")