Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11411/Python Modified Files: sysmodule.c Log Message: Add os.path.supports_unicode_filenames for all platforms, sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink> version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries. Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.110 retrieving revision 2.111 diff -C2 -d -r2.110 -r2.111 *** sysmodule.c 3 Sep 2002 20:10:45 -0000 2.110 --- sysmodule.c 8 Oct 2002 02:44:28 -0000 2.111 *************** *** 21,24 **** --- 21,29 ---- #include "osdefs.h" + #ifdef MS_WINDOWS + #define WIN32_LEAN_AND_MEAN + #include "windows.h" + #endif /* MS_WINDOWS */ + #ifdef MS_COREDLL extern void *PyWin_DLLhModule; *************** *** 405,408 **** --- 410,441 ---- ); + #ifdef MS_WINDOWS + PyDoc_STRVAR(getwindowsversion_doc, + "getwindowsversion()\n\ + \n\ + Return information about the running version of Windows.\n\ + The result is a tuple of (major, minor, build, platform, text)\n\ + All elements are numbers, except text which is a string.\n\ + Platform may be 0 for win32s, 1 for Windows 9x/ME, 2 for Windows NT/2000/XP\n\ + " + ); + + static PyObject * + sys_getwindowsversion(PyObject *self) + { + OSVERSIONINFO ver; + ver.dwOSVersionInfoSize = sizeof(ver); + if (!GetVersionEx(&ver)) + return PyErr_SetFromWindowsErr(0); + return Py_BuildValue("HHHHs", + ver.dwMajorVersion, + ver.dwMinorVersion, + ver.dwBuildNumber, + ver.dwPlatformId, + ver.szCSDVersion); + } + + #endif /* MS_WINDOWS */ + #ifdef HAVE_DLOPEN static PyObject * *************** *** 571,574 **** --- 604,611 ---- getrecursionlimit_doc}, {"_getframe", sys_getframe, METH_VARARGS, getframe_doc}, + #ifdef MS_WINDOWS + {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, + getwindowsversion_doc}, + #endif /* MS_WINDOWS */ #ifdef USE_MALLOPT {"mdebug", sys_mdebug, METH_VARARGS},
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4