Mercurial > cpython-lru_cache-weakref
comparison Python/import.c @ 35678:f0951fdaed37 legacy-trunk
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
Will backport.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 03 Oct 2005 04:48:15 +0000 |
| parents | 724bbd489ad4 |
| children | 1c4d192f1568 |
comparison
equal
deleted
inserted
replaced
| 35677:e9bae2febac8 | 35678:f0951fdaed37 |
|---|---|
| 866 char *cpathname; | 866 char *cpathname; |
| 867 PyCodeObject *co; | 867 PyCodeObject *co; |
| 868 PyObject *m; | 868 PyObject *m; |
| 869 | 869 |
| 870 mtime = PyOS_GetLastModificationTime(pathname, fp); | 870 mtime = PyOS_GetLastModificationTime(pathname, fp); |
| 871 if (mtime == (time_t)(-1)) | 871 if (mtime == (time_t)(-1)) { |
| 872 return NULL; | 872 PyErr_Format(PyExc_RuntimeError, |
| 873 "unable to get modification time from '%s'", | |
| 874 pathname); | |
| 875 return NULL; | |
| 876 } | |
| 873 #if SIZEOF_TIME_T > 4 | 877 #if SIZEOF_TIME_T > 4 |
| 874 /* Python's .pyc timestamp handling presumes that the timestamp fits | 878 /* Python's .pyc timestamp handling presumes that the timestamp fits |
| 875 in 4 bytes. This will be fine until sometime in the year 2038, | 879 in 4 bytes. This will be fine until sometime in the year 2038, |
| 876 when a 4-byte signed time_t will overflow. | 880 when a 4-byte signed time_t will overflow. |
| 877 */ | 881 */ |
