Commit a3c56090 authored by Hirokazu Yamamoto's avatar Hirokazu Yamamoto

Issue #4856: Remove checks for win NT.

parent ecb4f953
...@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1 ...@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #4856: Remove checks for win NT.
- Issue #2016: Fixed a crash in a corner case where the dictionary of keyword - Issue #2016: Fixed a crash in a corner case where the dictionary of keyword
arguments could be modified during the function call setup. arguments could be modified during the function call setup.
......
...@@ -224,11 +224,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) ...@@ -224,11 +224,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
} }
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
if (GetVersion() < 0x80000000) { if (PyUnicode_Check(nameobj))
/* On NT, so wide API available */ widename = PyUnicode_AS_UNICODE(nameobj);
if (PyUnicode_Check(nameobj))
widename = PyUnicode_AS_UNICODE(nameobj);
}
if (widename == NULL) if (widename == NULL)
#endif #endif
if (fd < 0) if (fd < 0)
......
This diff is collapsed.
...@@ -16,12 +16,6 @@ ...@@ -16,12 +16,6 @@
#include <windows.h> #include <windows.h>
#endif #endif
#ifdef _MSC_VER
/* Need GetVersion to see if on NT so safe to use _wfopen */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif /* _MSC_VER */
#if defined(PYOS_OS2) && defined(PYCC_GCC) #if defined(PYOS_OS2) && defined(PYCC_GCC)
#include <io.h> #include <io.h>
#endif #endif
...@@ -2244,6 +2238,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -2244,6 +2238,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds)
char *mode = "r"; char *mode = "r";
int bufsize = -1; int bufsize = -1;
int wideargument = 0; int wideargument = 0;
PyObject *po;
assert(PyFile_Check(self)); assert(PyFile_Check(self));
if (foself->f_fp != NULL) { if (foself->f_fp != NULL) {
...@@ -2255,19 +2250,16 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -2255,19 +2250,16 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds)
} }
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file",
PyObject *po; kwlist, &po, &mode, &bufsize)) {
if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file", wideargument = 1;
kwlist, &po, &mode, &bufsize)) { if (fill_file_fields(foself, NULL, po, mode,
wideargument = 1; fclose) == NULL)
if (fill_file_fields(foself, NULL, po, mode, goto Error;
fclose) == NULL) } else {
goto Error; /* Drop the argument parsing error as narrow
} else { strings are also valid. */
/* Drop the argument parsing error as narrow PyErr_Clear();
strings are also valid. */
PyErr_Clear();
}
} }
#endif #endif
......
...@@ -95,12 +95,6 @@ WIN32 is still required for the locale module. ...@@ -95,12 +95,6 @@ WIN32 is still required for the locale module.
#endif #endif
#ifdef MS_WINCE #ifdef MS_WINCE
/* Python uses GetVersion() to distinguish between
* Windows NT and 9x/ME where OS Unicode support is concerned.
* Windows CE supports Unicode in the same way as NT so we
* define the missing GetVersion() accordingly.
*/
#define GetVersion() (4)
/* Windows CE does not support environment variables */ /* Windows CE does not support environment variables */
#define getenv(v) (NULL) #define getenv(v) (NULL)
#define environ (NULL) #define environ (NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment