diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-01-21 10:09:02 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-01-30 14:15:33 +1100 |
commit | 2aecf378be3190920fd0e50aff6ccdc83ecfd7e9 (patch) | |
tree | 0e457691745efa0a8dafb4e4a82b1e200e92717e /tools/makemanifest.py | |
parent | 499e199addacd3777244c61cc4c3b4efdfa9b300 (diff) | |
download | micropython-2aecf378be3190920fd0e50aff6ccdc83ecfd7e9.tar.gz micropython-2aecf378be3190920fd0e50aff6ccdc83ecfd7e9.zip |
tools/makemanifest.py: Add check that freeze path is a directory.
Avoids accidentally writing
freeze("path/to/file.py")
and getting unexpected results.
Diffstat (limited to 'tools/makemanifest.py')
-rw-r--r-- | tools/makemanifest.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/makemanifest.py b/tools/makemanifest.py index 9ef0368260..c07a3a6c77 100644 --- a/tools/makemanifest.py +++ b/tools/makemanifest.py @@ -172,6 +172,8 @@ def mkdir(filename): def freeze_internal(kind, path, script, opt): path = convert_path(path) + if not os.path.isdir(path): + raise FreezeError("freeze path must be a directory") if script is None and kind == KIND_AS_STR: if any(f[0] == KIND_AS_STR for f in manifest_list): raise FreezeError("can only freeze one str directory") |