diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 8111b2b7d..8a2b22c75 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -347,7 +347,8 @@ def handle_licenses(): special_license_files.get(titles_dict[selected_title], "LICENSE"), "w" ) as f: # +2 to get rid of the --- and and an extra new line - f.writelines(contents[contents.index("---\n", 1) + 2:]) + i = contents.index("---\n", 1) + 2 + f.writelines(contents[i:]) shutil.rmtree("licenses")