Skip to content
Snippets Groups Projects
Commit 16fc60ca authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Create output directory if necessary

parent 28132b10
Branches
Tags
No related merge requests found
...@@ -89,7 +89,17 @@ def main(): ...@@ -89,7 +89,17 @@ def main():
parser.error("Input video file '%s' cannot be read" % args.video) parser.error("Input video file '%s' cannot be read" % args.video)
output = sys.stdout output = sys.stdout
if args.output is not None: if args.output is not None:
dirname = os.path.dirname(args.output)
if dirname and not os.path.exists(dirname):
try:
os.makedirs(dirname)
except OSError as exc:
if exc.errno == errno.EEXIST: pass
else: raise
output = open(args.output, 'wt') output = open(args.output, 'wt')
op = Localizer() op = Localizer()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment