@@ -110,16 +110,24 @@ typedef unsigned short mode_t;
110110 TAG and PYC_TAG_UNICODE must change for each major Python release. The magic
111111 number will take care of any bytecode changes that occur during development.
112112*/
113+ #define QUOTE (arg ) #arg
114+ #define STRIFY (name ) QUOTE(name)
115+ #define MAJOR STRIFY(PY_MAJOR_VERSION)
116+ #define MINOR STRIFY(PY_MINOR_VERSION)
113117#define MAGIC (3180 | ((long)'\r'<<16) | ((long)'\n'<<24))
114- #define TAG "cpython-32"
118+ #define TAG "cpython-" MAJOR MINOR;
115119#define CACHEDIR "__pycache__"
116120static const Py_UNICODE CACHEDIR_UNICODE [] = {
117121 '_' , '_' , 'p' , 'y' , 'c' , 'a' , 'c' , 'h' , 'e' , '_' , '_' , '\0' };
118122/* Current magic word and string tag as globals. */
119123static long pyc_magic = MAGIC ;
120124static const char * pyc_tag = TAG ;
121125static const Py_UNICODE PYC_TAG_UNICODE [] = {
122- 'c' , 'p' , 'y' , 't' , 'h' , 'o' , 'n' , '-' , '3' , '2' , '\0' };
126+ 'c' , 'p' , 'y' , 't' , 'h' , 'o' , 'n' , '-' , PY_MAJOR_VERSION + 48 , PY_MINOR_VERSION + 48 , '\0' };
127+ #undef QUOTE
128+ #undef STRIFY
129+ #undef MAJOR
130+ #undef MINOR
123131
124132/* See _PyImport_FixupExtensionObject() below */
125133static PyObject * extensions = NULL ;
0 commit comments