New submission from STINNER Victor <victor.stin...@haypocalc.com>: Sometimes, we need to know the version of the Linux kernel. Recent examples: test if SOCK_CLOEXEC or O_CLOEXEC are supported by the kernel or not. Linux < 2.6.23 *silently* ignores O_CLOEXEC flag of open().
linux_version() is already implemented in test_socket, but it looks like test_posix does also need it. Attached patch adds platform.linux_version(). It returns (a, b, c) (integers) or None (if not Linux). It raises an error if the version string cannot be parsed. ---------- components: Library (Lib) files: platform_linux_version.patch keywords: patch messages: 136621 nosy: charles-francois.natali, haypo, lemburg, pitrou priority: normal severity: normal status: open title: platform: add linux_version() versions: Python 3.3 Added file: http://bugs.python.org/file22079/platform_linux_version.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12158> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com