diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ad505364bda9da..83f411e38eb609 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -570,6 +570,9 @@ extern __declspec(dllimport) char * __pioinfo[]; int _PyVerify_fd(int fd) { +#if (_MSC_VER >= 1900) //VS2015+ + return 1; //rely on other error checking, as __pioinfo is no longer exported +#else const int i1 = fd >> IOINFO_L2E; const int i2 = fd & ((1 << IOINFO_L2E) - 1); @@ -602,6 +605,7 @@ _PyVerify_fd(int fd) fail: errno = EBADF; return 0; +#endif } /* the special case of checking dup2. The target fd must be in a sensible range */ diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 12c43b08fe4a81..88cc958960b0ac 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -705,7 +705,18 @@ inittimezone(PyObject *m) { And I'm lazy and hate C so nyer. */ -#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) +#if defined(HAVE_TZNAME) && (_MSC_VER >= 1900) //VS2015+ + tzset(); + PyModule_AddIntConstant(m, "timezone", _timezone); +#ifdef HAVE_ALTZONE + PyModule_AddIntConstant(m, "altzone", altzone); +#else + PyModule_AddIntConstant(m, "altzone", _timezone-3600); +#endif + PyModule_AddIntConstant(m, "daylight", _daylight); + PyModule_AddObject(m, "tzname", + Py_BuildValue("(zz)", _tzname[0], _tzname[1])); +#elif defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) tzset(); #ifdef PYOS_OS2 PyModule_AddIntConstant(m, "timezone", _timezone);