Commit 62eddbf81859a512faadc9219e57a9064f580ddd

Authored by Thiago Franco de Moraes
1 parent c545a15d
Exists in master

_winreg -> winreg

Showing 1 changed file with 7 additions and 4 deletions   Show diff stats
app.py
... ... @@ -30,7 +30,10 @@ import traceback
30 30 import re
31 31  
32 32 if sys.platform == 'win32':
33   - import _winreg
  33 + try:
  34 + import winreg
  35 + except ImportError:
  36 + import _winreg as winreg
34 37 # else:
35 38 # if sys.platform != 'darwin':
36 39 # import wxversion
... ... @@ -472,10 +475,10 @@ if __name__ == '__main__':
472 475 if hasattr(sys,"frozen") and sys.platform.startswith('win'):
473 476  
474 477 #Click in the .inv3 file support
475   - root = _winreg.HKEY_CLASSES_ROOT
  478 + root = winreg.HKEY_CLASSES_ROOT
476 479 key = "InVesalius 3.1\InstallationDir"
477   - hKey = _winreg.OpenKey (root, key, 0, _winreg.KEY_READ)
478   - value, type_ = _winreg.QueryValueEx (hKey, "")
  480 + hKey = winreg.OpenKey (root, key, 0, winreg.KEY_READ)
  481 + value, type_ = winreg.QueryValueEx (hKey, "")
479 482 path = os.path.join(value,'dist')
480 483  
481 484 os.chdir(path)
... ...