Skip to content

Commit

Permalink
tools/makemanifest.py: Add check that freeze path is a directory.
Browse files Browse the repository at this point in the history
Avoids accidentally writing

    freeze("path/to/file.py")

and getting unexpected results.
  • Loading branch information
jimmo authored and dpgeorge committed Jan 30, 2021
1 parent 499e199 commit 2aecf37
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/makemanifest.py
Expand Up @@ -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")
Expand Down

0 comments on commit 2aecf37

Please sign in to comment.