pyoxidizer: make sure defaultrc directory exists before trying to write to it
authorAugie Fackler <augie@google.com>
Wed, 25 Nov 2020 11:08:28 -0500
changeset 45922 37bcd7f5a543
parent 45921 777e8d88f703
child 45923 ead435aa5294
pyoxidizer: make sure defaultrc directory exists before trying to write to it When doing some work involving one-file binaries, this line is failing for me. It seems reasonable to just make sure the destination directory exists before splatting the file into it. Differential Revision: https://phab.mercurial-scm.org/D9401
contrib/packaging/hgpackaging/pyoxidizer.py
--- a/contrib/packaging/hgpackaging/pyoxidizer.py	Sat Nov 21 13:30:50 2020 +0530
+++ b/contrib/packaging/hgpackaging/pyoxidizer.py	Wed Nov 25 11:08:28 2020 -0500
@@ -127,6 +127,7 @@
 
         # Write out a default editor.rc file to configure notepad as the
         # default editor.
+        os.makedirs(out_dir / "defaultrc", exist_ok=True)
         with (out_dir / "defaultrc" / "editor.rc").open(
             "w", encoding="utf-8"
         ) as fh: