comparison Python/import.c @ 35679:172fcd9c1952 2.4

Backport: Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
author Neal Norwitz <nnorwitz@gmail.com>
date Mon, 03 Oct 2005 04:50:55 +0000
parents 57f630a9de26
children 6fb46e87d5f9
comparison
equal deleted inserted replaced
35676:e1df48f2847a 35679:172fcd9c1952
865 char *cpathname; 865 char *cpathname;
866 PyCodeObject *co; 866 PyCodeObject *co;
867 PyObject *m; 867 PyObject *m;
868 868
869 mtime = PyOS_GetLastModificationTime(pathname, fp); 869 mtime = PyOS_GetLastModificationTime(pathname, fp);
870 if (mtime == (time_t)(-1)) 870 if (mtime == (time_t)(-1)) {
871 return NULL; 871 PyErr_Format(PyExc_RuntimeError,
872 "unable to get modification time from '%s'",
873 pathname);
874 return NULL;
875 }
872 #if SIZEOF_TIME_T > 4 876 #if SIZEOF_TIME_T > 4
873 /* Python's .pyc timestamp handling presumes that the timestamp fits 877 /* Python's .pyc timestamp handling presumes that the timestamp fits
874 in 4 bytes. This will be fine until sometime in the year 2038, 878 in 4 bytes. This will be fine until sometime in the year 2038,
875 when a 4-byte signed time_t will overflow. 879 when a 4-byte signed time_t will overflow.
876 */ 880 */