fixes for working with py2exe on python 3
This commit is contained in:
parent
70e7a429a7
commit
5403896b79
|
@ -9,7 +9,7 @@ class SetupOSX(Setup):
|
|||
|
||||
def __init__(self, launcher_path, data_file_paths,
|
||||
config_file_path="config"):
|
||||
Setup.__init__(self)
|
||||
Setup.__init__(self)
|
||||
self.launcher_path = launcher_path
|
||||
self.data_file_paths = data_file_paths
|
||||
self.config_file_path = config_file_path
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
from os import makedirs, walk, sep, remove
|
||||
from os.path import join, dirname, basename, exists
|
||||
from shutil import rmtree, copy, rmtree
|
||||
|
@ -12,7 +13,8 @@ class SetupWin(Setup):
|
|||
|
||||
def __init__(self):
|
||||
Setup.__init__(self)
|
||||
self.replace_isSystemDLL()
|
||||
if sys.version_info[0] < 3:
|
||||
self.replace_isSystemDLL()
|
||||
|
||||
def replace_isSystemDLL(self):
|
||||
origIsSystemDLL = py2exe.build_exe.isSystemDLL
|
||||
|
@ -23,7 +25,8 @@ class SetupWin(Setup):
|
|||
py2exe.build_exe.isSystemDLL = isSystemDLL
|
||||
|
||||
def setup(self):
|
||||
self.numpy_dll_paths_fix()
|
||||
if sys.version_info[0] < 3 or sys.version_info[1] >= 5:
|
||||
self.numpy_dll_paths_fix()
|
||||
config = self.config.get_section("setup")
|
||||
windows = [{}]
|
||||
if config["init-script"]:
|
||||
|
@ -51,7 +54,7 @@ class SetupWin(Setup):
|
|||
|
||||
def copy_data_files(self):
|
||||
root = self.config.get("setup", "windows-dist-path")
|
||||
for path in chain(*zip(*self.build_data_map())[1]):
|
||||
for path in chain(*list(zip(*self.build_data_map()))[1]):
|
||||
dest = join(root, dirname(path))
|
||||
if not exists(dest):
|
||||
makedirs(dest)
|
||||
|
|
Loading…
Reference in New Issue