Merge commit 'ac3b8ebfccfc626c19d1ae731df65cd408f9b9c4' into py23

This commit is contained in:
Matthias Urlichs committed 2019-01-27 17:16:14 +01:00
commit ea5ef34cc1
1 file changed
+8 -5
+8 -5
View File
@@ -41,9 +41,12 @@ from octoprint.util import get_exception_string, sanitize_ascii, filter_non_asci
to_unicode, bom_aware_open, TypedQueue, PrependableQueue, TypeAlreadyInQueue, chunks, ResettableTimer
try:
import _winreg
except:
pass
import winreg
except ImportError:
try:
import _winreg as winreg
except:
pass
_logger = logging.getLogger(__name__)
@@ -158,10 +161,10 @@ def serialList():
baselist=[]
if os.name=="nt":
try:
key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM")
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM")
i=0
while(1):
baselist+=[_winreg.EnumValue(key,i)[1]]
baselist+=[winreg.EnumValue(key,i)[1]]
i+=1
except:
pass