Skip to content

Commit 6fba1e4

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/mpy-tool.py

+2-2
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)