mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Suppress a compiler warning under OpenVMS; time_t is unsigned on (at least)
the more recent versions of that platform, so we use the value (time_t)(-1) as the error value. This is the type used in the OpenVMS documentation: http://www.openvms.compaq.com/commercial/c/5763p048.htm#inde This closes SF tracker bug #404240. Also clean up an exception message when detecting overflow of time_t values beyond 4 bytes.
This commit is contained in:
parent
7889107be7
commit
c63d3e9453
1 changed files with 2 additions and 2 deletions
|
@ -702,7 +702,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
mtime = PyOS_GetLastModificationTime(pathname, fp);
|
mtime = PyOS_GetLastModificationTime(pathname, fp);
|
||||||
if (mtime == -1)
|
if (mtime == (time_t)(-1))
|
||||||
return NULL;
|
return NULL;
|
||||||
#if SIZEOF_TIME_T > 4
|
#if SIZEOF_TIME_T > 4
|
||||||
/* Python's .pyc timestamp handling presumes that the timestamp fits
|
/* Python's .pyc timestamp handling presumes that the timestamp fits
|
||||||
|
@ -711,7 +711,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
|
||||||
*/
|
*/
|
||||||
if (mtime >> 32) {
|
if (mtime >> 32) {
|
||||||
PyErr_SetString(PyExc_OverflowError,
|
PyErr_SetString(PyExc_OverflowError,
|
||||||
"modification time overflows a 4 bytes");
|
"modification time overflows a 4 byte field");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue