Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c63d3e9

Browse files
committed
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.
1 parent 7889107 commit c63d3e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/import.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
702702
PyObject *m;
703703

704704
mtime = PyOS_GetLastModificationTime(pathname, fp);
705-
if (mtime == -1)
705+
if (mtime == (time_t)(-1))
706706
return NULL;
707707
#if SIZEOF_TIME_T > 4
708708
/* Python's .pyc timestamp handling presumes that the timestamp fits
@@ -711,7 +711,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
711711
*/
712712
if (mtime >> 32) {
713713
PyErr_SetString(PyExc_OverflowError,
714-
"modification time overflows a 4 bytes");
714+
"modification time overflows a 4 byte field");
715715
return NULL;
716716
}
717717
#endif

0 commit comments

Comments
 (0)