comparison Python/pythonrun.c @ 74358:87331661042b

Issue #13645: pyc files now contain the size of the corresponding source code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
author Antoine Pitrou <solipsis@pitrou.net>
date Fri, 13 Jan 2012 18:52:16 +0100
parents 021e5bb297d1
children a321ffb21367
comparison
equal deleted inserted replaced
74357:bb94a16ac984 74358:87331661042b
1842 if (magic != PyImport_GetMagicNumber()) { 1842 if (magic != PyImport_GetMagicNumber()) {
1843 PyErr_SetString(PyExc_RuntimeError, 1843 PyErr_SetString(PyExc_RuntimeError,
1844 "Bad magic number in .pyc file"); 1844 "Bad magic number in .pyc file");
1845 return NULL; 1845 return NULL;
1846 } 1846 }
1847 /* Skip mtime and size */
1848 (void) PyMarshal_ReadLongFromFile(fp);
1847 (void) PyMarshal_ReadLongFromFile(fp); 1849 (void) PyMarshal_ReadLongFromFile(fp);
1848 v = PyMarshal_ReadLastObjectFromFile(fp); 1850 v = PyMarshal_ReadLastObjectFromFile(fp);
1849 fclose(fp); 1851 fclose(fp);
1850 if (v == NULL || !PyCode_Check(v)) { 1852 if (v == NULL || !PyCode_Check(v)) {
1851 Py_XDECREF(v); 1853 Py_XDECREF(v);