@@ -80,7 +80,7 @@ def finalize_options(self):
8080 def copy_emulator (self ):
8181 tempdir = tempfile .mkdtemp ()
8282 zippath = join (tempdir , basename (self .url ))
83- urllib .urlretrieve (self .url , zippath )
83+ urllib .request . urlretrieve (self .url , zippath )
8484 zf = zipfile .ZipFile (zippath )
8585 for name in zf .namelist ():
8686 if self .arch in name :
@@ -101,17 +101,25 @@ def copy_emulator(self):
101101 shutil .rmtree (tempdir )
102102
103103 def copy_files (self ):
104- tempdir = tempfile .mkdtemp ()
105104 dest_path = join (self .dist_dir , "m64py" )
106105 rar_dir = join (os .environ ["ProgramFiles(x86)" ], "Unrar" )
107106 if not os .path .isfile (join (rar_dir , "UnRAR.exe" )):
108- urllib .urlretrieve ("http://www.rarlab.com/rar/unrarw32.exe" , join (tempdir , "unrar.exe" ))
107+ tempdir = tempfile .mkdtemp ()
108+ urllib .request .urlretrieve ("http://www.rarlab.com/rar/unrarw32.exe" , join (tempdir , "unrar.exe" ))
109109 subprocess .call ([join (tempdir , "unrar.exe" ), "-s" ])
110+ shutil .rmtree (tempdir )
110111 shutil .copy (join (rar_dir , "UnRAR.exe" ), dest_path )
111112 shutil .copy (join (rar_dir , "license.txt" ), join (dest_path , "doc" , "unrar-license.txt" ))
112113 for file_name in ["AUTHORS" , "ChangeLog" , "COPYING" , "LICENSES" , "README.md" ]:
113114 shutil .copy (join (BASE_DIR , file_name ), dest_path )
114- shutil .rmtree (tempdir )
115+
116+ import PyQt5
117+ qt5_dir = dirname (PyQt5 .__file__ )
118+ qwindows = join (qt5_dir , "plugins" , "platforms" , "qwindows.dll" )
119+ qwindows_dest = join (dest_path , "qt5_plugins" , "platforms" )
120+ if not os .path .exists (qwindows_dest ):
121+ os .makedirs (qwindows_dest )
122+ shutil .copy (qwindows , qwindows_dest )
115123
116124 def remove_files (self ):
117125 dest_path = join (self .dist_dir , "m64py" )
@@ -251,8 +259,6 @@ def set_rthook():
251259 hook_file += line + "\n "
252260 if "MEIPASS" in line :
253261 hook_file += "\n import sip\n "
254- hook_file += "sip.setapi('QString', 2)\n "
255- hook_file += "sip.setapi('QVariant', 2)\n "
256262 with open (rthook , "w" ) as hook : hook .write (hook_file )
257263
258264
0 commit comments