docutil/docpdf.py
changeset 2431 6923074540dd
parent 1881 091005ec69c4
child 3750 f62625418bff
--- a/docutil/docpdf.py	Wed Oct 03 15:47:59 2018 +0300
+++ b/docutil/docpdf.py	Thu Oct 04 11:25:42 2018 +0300
@@ -34,16 +34,16 @@
 
 def get_acroversion():
     " Return version of Adobe Acrobat executable or None"
-    import _winreg
-    adobesoft = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'Software\Adobe')
-    for index in range(_winreg.QueryInfoKey(adobesoft)[0]):
-        key = _winreg.EnumKey(adobesoft, index)
+    from six.moves import winreg
+    adobesoft = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'Software\Adobe')
+    for index in range(winreg.QueryInfoKey(adobesoft)[0]):
+        key = winreg.EnumKey(adobesoft, index)
         if "acrobat" in key.lower():
-            acrokey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s' % key)
-            for index in range(_winreg.QueryInfoKey(acrokey)[0]):
-                numver = _winreg.EnumKey(acrokey, index)
+            acrokey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s' % key)
+            for index in range(winreg.QueryInfoKey(acrokey)[0]):
+                numver = winreg.EnumKey(acrokey, index)
                 try:
-                    res = _winreg.QueryValue(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s\\%s\\InstallPath' % (key, numver))
+                    res = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s\\%s\\InstallPath' % (key, numver))
                     return res
                 except Exception:
                     pass