--- runtime.py	Tue Aug 21 19:43:57 2012
+++ runtime_fixed.py	Tue Aug 21 21:58:39 2012
@@ -10,7 +10,6 @@
 import imp
 
 
-
 def shortPythonVersion():
     """
     Returns the Python version as a dot-separated string.
@@ -73,12 +72,17 @@
     def isWinNT(self):
         """Are we running in Windows NT?"""
         if self.getType() == 'win32':
-            import _winreg
+            # Python 3.x changed this name.
+            winreg = None
+            if sys.version_info[0] == 2:
+                winreg = __import__('_winreg')
+            else:
+                winreg = __import__('winreg')
             try:
-                k = _winreg.OpenKeyEx(
-                        _winreg.HKEY_LOCAL_MACHINE,
+                k = winreg.OpenKeyEx(
+                        winreg.HKEY_LOCAL_MACHINE,
                         r'Software\Microsoft\Windows NT\CurrentVersion')
-                _winreg.QueryValueEx(k, 'SystemRoot')
+                winreg.QueryValueEx(k, 'SystemRoot')
                 return 1
             except WindowsError:
                 return 0
@@ -117,7 +121,11 @@
         """Can threads be created?
         """
         try:
-            return imp.find_module('thread')[0] is None
+            # Python 3.x changed this name.
+            if sys.version_info[0] == 2:
+                return imp.find_module('thread')[0] is None
+            else:
+                return imp.find_module('_thread')[0] is None
         except ImportError:
             return False
 
