[Jython-checkins] jython: Fixed #2561.

stefan.richthofer jython-checkins at python.org
Fri Mar 3 12:50:20 EST 2017


https://hg.python.org/jython/rev/862934df72f6
changeset:   8044:862934df72f6
user:        Stefan Richthofer <stefan.richthofer at gmx.de>
date:        Fri Mar 03 18:50:10 2017 +0100
summary:
  Fixed #2561.

files:
  Lib/platform.py |  6 ++++++
  NEWS            |  1 +
  2 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Lib/platform.py b/Lib/platform.py
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -588,6 +588,12 @@
         from win32con import HKEY_LOCAL_MACHINE, VER_PLATFORM_WIN32_NT, \
              VER_PLATFORM_WIN32_WINDOWS, VER_NT_WORKSTATION
     except ImportError:
+        if sys.platform.startswith("java"):
+            if os._name == 'nt':
+                unm = os.uname()
+                return unm[2], unm[3], csd, ptype
+            else:
+                return release, version, csd, ptype
         # Emulate the win32api module using Python APIs
         try:
             sys.getwindowsversion
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
 
 Jython 2.7.1rc1
   Bugs fixed
+    - [ 2561 ] win32_ver raises exception (breaks test_platform on windows)
     - [ 2521 ] Windows installation (all) fails on Windows 10
     - [ 2557 ] ongoing pain with platform detection via os.name and sys.platform
     - [ 1996 ] Core slots array out of bounds with multiple inheritance

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list