mirror of https://github.com/n1nj4sec/pupy.git
build_library_zip: handle case when byte compilation failed
This commit is contained in:
parent
c5af8ee96c
commit
e763fbf732
|
@ -210,17 +210,19 @@ try:
|
||||||
[PATCHES] + ziproot.split('/'))
|
[PATCHES] + ziproot.split('/'))
|
||||||
ext = '.py'
|
ext = '.py'
|
||||||
|
|
||||||
print('adding file : {}'.format(zipname))
|
|
||||||
content.add(zipname)
|
|
||||||
|
|
||||||
if ext == '.py' and need_compile:
|
if ext == '.py' and need_compile:
|
||||||
zf.writestr(
|
bytecode = compile_py(os.path.join(file_root, f+ext))
|
||||||
zipname+'o',
|
if not bytecode:
|
||||||
compile_py(os.path.join(file_root, f+ext)))
|
print('[!] Failed to compile: ', f+ext)
|
||||||
|
continue
|
||||||
|
|
||||||
|
zf.writestr(zipname+'o', bytecode)
|
||||||
else:
|
else:
|
||||||
zf.write(os.path.join(
|
zf.write(os.path.join(
|
||||||
file_root, f+ext), zipname)
|
file_root, f+ext), zipname)
|
||||||
|
|
||||||
|
print('adding file : {}'.format(zipname))
|
||||||
|
content.add(zipname)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if '<memimport>' in mpath:
|
if '<memimport>' in mpath:
|
||||||
|
|
Loading…
Reference in New Issue