Skip to content

Commit

Permalink
optimize writefile
Browse files Browse the repository at this point in the history
Signed-off-by: ilya.kuksenok <[email protected]>
  • Loading branch information
ilya.kuksenok committed Jun 21, 2023
1 parent e9a99a8 commit 66f6f71
Show file tree
Hide file tree
Showing 2 changed files with 754 additions and 752 deletions.
4 changes: 3 additions & 1 deletion src/ocispec/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ def reflection(schema_info, gen_ref):
structs = expand(tree, [], {})
headers_text = []
headers.header_reflect(structs, schema_info, headers_text)
source_text = []
header_file.writelines(headers_text)
sources.src_reflect(structs, schema_info, source_file, tree.typ)
sources.src_reflect(structs, schema_info, source_text, tree.typ)
source_file.writelines(source_text)
except RuntimeError:
traceback.print_exc()
print("Failed to parse schema file: %s" % schema_info.name.name)
Expand Down
Loading

0 comments on commit 66f6f71

Please sign in to comment.