add os.makedirs on pyfnwriter output path
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 18 May 2021 09:06:10 +0000 (10:06 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 18 May 2021 09:06:10 +0000 (10:06 +0100)
src/openpower/decoder/pseudo/pyfnwriter.py

index c6e37b4074230db3d7fd78dfccf7ca9f2063bb1b..c5dac0d82389850827f6833f720be17991eb8b67 100644 (file)
@@ -43,6 +43,7 @@ class PyISAFnWriter(ISAFunctions):
         self.pages_written.append(pagename)
         function = self.fns[pagename]
         isadir = get_isafn_src_dir()
+        os.makedirs(isadir, exist_ok=True)
         fname = os.path.join(isadir, "%s.py" % pagename)
         with open(fname, "w") as f:
             f.write(header % function['desc'])  # write out header