Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91e8a2f

Browse files
vshymanskyyprojectgus
authored andcommitted
tools/mpy-tool: Support calling main() from an external script.
Signed-off-by: Volodymyr Shymanskyy <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent f980da3 commit 91e8a2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/mpy-tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ def copy_section(file, offset, offset2):
17651765
f.write(merged_mpy)
17661766

17671767

1768-
def main():
1768+
def main(args=None):
17691769
global global_qstrs
17701770

17711771
import argparse
@@ -1797,7 +1797,7 @@ def main():
17971797
)
17981798
cmd_parser.add_argument("-o", "--output", default=None, help="output file")
17991799
cmd_parser.add_argument("files", nargs="+", help="input .mpy files")
1800-
args = cmd_parser.parse_args()
1800+
args = cmd_parser.parse_args(args)
18011801

18021802
# set config values relevant to target machine
18031803
config.MICROPY_LONGINT_IMPL = {

0 commit comments

Comments
 (0)