Commit 0e9c3ace194d618d671272f785940a47cd0e9567

Authored by Paulo Henrique Junqueira Amorim
1 parent 274fff72

ENH: Add suport multiprocess from Windows executable

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
invesalius/invesalius.py
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais 17 # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais
18 # detalhes. 18 # detalhes.
19 #-------------------------------------------------------------------------- 19 #--------------------------------------------------------------------------
20 - 20 +import multiprocessing
21 from optparse import OptionParser 21 from optparse import OptionParser
22 import os 22 import os
23 import sys 23 import sys
@@ -106,8 +106,14 @@ def main(): @@ -106,8 +106,14 @@ def main():
106 application.MainLoop() 106 application.MainLoop()
107 107
108 if __name__ == '__main__': 108 if __name__ == '__main__':
  109 +
  110 + #Necessary in case run from executable
  111 + if (sys.platform == "win32"):
  112 + multiprocessing.freeze_support()
  113 +
109 # Add current directory to PYTHONPATH 114 # Add current directory to PYTHONPATH
110 sys.path.append(".") 115 sys.path.append(".")
  116 +
111 # Init application 117 # Init application
112 main() 118 main()
113 119