Fixing python 3 import of winreg in installer asset.

This commit is contained in:
Joseph Nix 2017-08-16 15:36:12 -05:00
parent f84521da7e
commit beb5c3d0f0
1 changed files with 7 additions and 4 deletions

View File

@ -6,12 +6,15 @@ import tempfile
import tarfile import tarfile
import shutil import shutil
from subprocess import Popen from subprocess import Popen
try: try: # py3
from urllib.request import urlopen from urllib.request import urlopen
except ImportError: from winreg import OpenKey, CloseKey, QueryValueEx, SetValueEx, \
from urllib import urlopen
from _winreg import OpenKey, CloseKey, QueryValueEx, SetValueEx, \
HKEY_CURRENT_USER, KEY_ALL_ACCESS, REG_EXPAND_SZ HKEY_CURRENT_USER, KEY_ALL_ACCESS, REG_EXPAND_SZ
except ImportError: # py2
from urllib import urlopen
from _winreg import OpenKey, CloseKey, QueryValueEx, SetValueEx, \
HKEY_CURRENT_USER, KEY_ALL_ACCESS, REG_EXPAND_SZ
import ctypes import ctypes
from ctypes.wintypes import HWND, UINT, WPARAM, LPARAM, LPVOID from ctypes.wintypes import HWND, UINT, WPARAM, LPARAM, LPVOID