Skip to content

Commit

Permalink
Fix logger setting is changed by PyInstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
jondy committed May 8, 2023
1 parent c09704e commit fd64297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 6 additions & 3 deletions src/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from .shell import PyarmorShell
from .plugin import Plugin
from .generate import Builder
from .repack import Repacker


def _cmd_gen_key(builder, options):
Expand Down Expand Up @@ -222,10 +221,14 @@ def cmd_gen(ctx, args):
_cmd_gen_key(builder, options)
elif args.inputs[0].lower() in ('runtime', 'run', 'r'):
_cmd_gen_runtime(builder, options)
else:
packer = Repacker(args.pack, ctx.repack_path) if args.pack else None
elif args.pack:
from .repack import Repacker
packer = Repacker(args.pack, ctx.repack_path)
builder.process(options, packer=packer)
Plugin.post_build(ctx, pack=args.pack)
else:
builder.process(options)
Plugin.post_build(ctx)


def cmd_cfg(ctx, args):
Expand Down
9 changes: 0 additions & 9 deletions src/cli/repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,3 @@ def repack(self, obfpath, rtname, entry=None):
shutil.copy2(rtbinary, dest)

repack_executable(executable, buildpath, obfpath, rtentry)


if __name__ == '__main__':
logging.basicConfig(
level=logging.DEBUG,
format='%(message)s',
)
dest = '.pyarmor/pack'
os.makedirs(dest, exist_ok=True)

0 comments on commit fd64297

Please sign in to comment.