Skip to content

Commit

Permalink
Merge pull request BSVino#122 from jacquesh/fix-python3-windows-compile
Browse files Browse the repository at this point in the history
Fix compile process for python3 on Windows
  • Loading branch information
BSVino authored Jul 31, 2022
2 parents 0ff26f7 + 2ebd0cf commit 67d3053
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import argparse
import re
import zipfile
import codecs

import opengl
import glsl
Expand Down Expand Up @@ -824,9 +825,8 @@ def spew_category(name, commands, current_command, api):
if command_file == False:
raise IOError("Couldn't find page for command " + command + " (" + version + ")")

fp = open(command_file)
command_html = fp.read()
fp.close()
with codecs.open(command_file, mode="r", encoding="utf-8") as fp:
command_html = fp.read()

if args.buildmode == 'full':
command_html = command_html
Expand Down Expand Up @@ -942,12 +942,12 @@ def replace_alias(matchobj):

output_html = header_for_command + command_html + footer_for_command

output = open(output_dir + version_dir + "/" + command, "w")
output_string = output_html
if args.buildmode == 'full':
output_string = htmlmin.minify(output_html, remove_comments=True, reduce_boolean_attributes=True, remove_optional_attribute_quotes=False).encode('ascii', 'xmlcharrefreplace').decode('ascii')
output.write(output_string)
output.close()
output_path = output_dir + version_dir + "/" + command
with codecs.open(output_path, mode="w", encoding="utf-8") as output:
output_string = output_html
if args.buildmode == 'full':
output_string = htmlmin.minify(output_html, remove_comments=True, reduce_boolean_attributes=True, remove_optional_attribute_quotes=False).encode('ascii', 'xmlcharrefreplace').decode('ascii')
output.write(output_string)

written += 1

Expand Down

0 comments on commit 67d3053

Please sign in to comment.