diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-06-28 10:23:00 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-06-28 10:23:00 (GMT) |
commit | a3c560907972822a661b4fa933ac9637145c5048 (patch) | |
tree | ad93893920eba4603c1d54dc86cec1a4c9a4aad7 /Objects/fileobject.c | |
parent | ecb4f953dd8fdfc17de759dcd3bf737debcb7284 (diff) | |
download | cpython-a3c560907972822a661b4fa933ac9637145c5048.zip cpython-a3c560907972822a661b4fa933ac9637145c5048.tar.gz cpython-a3c560907972822a661b4fa933ac9637145c5048.tar.bz2 |
Issue #4856: Remove checks for win NT.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index ff30745..4c523d4 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -16,12 +16,6 @@ #include <windows.h> #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) #include <io.h> #endif @@ -2244,6 +2238,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) char *mode = "r"; int bufsize = -1; int wideargument = 0; + PyObject *po; assert(PyFile_Check(self)); if (foself->f_fp != NULL) { @@ -2255,19 +2250,16 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) } #ifdef MS_WINDOWS - if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ - PyObject *po; - if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file", - kwlist, &po, &mode, &bufsize)) { - wideargument = 1; - if (fill_file_fields(foself, NULL, po, mode, - fclose) == NULL) - goto Error; - } else { - /* Drop the argument parsing error as narrow - strings are also valid. */ - PyErr_Clear(); - } + if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file", + kwlist, &po, &mode, &bufsize)) { + wideargument = 1; + if (fill_file_fields(foself, NULL, po, mode, + fclose) == NULL) + goto Error; + } else { + /* Drop the argument parsing error as narrow + strings are also valid. */ + PyErr_Clear(); } #endif |