From beb5c3d0f094b89ba590a0857f330ebf958524a7 Mon Sep 17 00:00:00 2001 From: Joseph Nix Date: Wed, 16 Aug 2017 15:36:12 -0500 Subject: [PATCH] Fixing python 3 import of winreg in installer asset. --- assets/install.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/install.ps1 b/assets/install.ps1 index 8d49a5f8..6691ab7a 100644 --- a/assets/install.ps1 +++ b/assets/install.ps1 @@ -6,12 +6,15 @@ import tempfile import tarfile import shutil from subprocess import Popen -try: +try: # py3 from urllib.request import urlopen -except ImportError: - from urllib import urlopen -from _winreg import OpenKey, CloseKey, QueryValueEx, SetValueEx, \ + from winreg import OpenKey, CloseKey, QueryValueEx, SetValueEx, \ 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 from ctypes.wintypes import HWND, UINT, WPARAM, LPARAM, LPVOID