Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2af1d89

Browse files
committed
Open output files in text mode, after all they are text files.
(Binary mode caused problems when "python" was 3.0.)
1 parent ad3562e commit 2af1d89

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Parser/asdl_c.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def main(srcfile):
741741
sys.exit(1)
742742
if INC_DIR:
743743
p = "%s/%s-ast.h" % (INC_DIR, mod.name)
744-
f = open(p, "wb")
744+
f = open(p, "w")
745745
f.write(auto_gen_msg)
746746
f.write('#include "asdl.h"\n\n')
747747
c = ChainOfVisitors(TypeDefVisitor(f),
@@ -754,7 +754,7 @@ def main(srcfile):
754754

755755
if SRC_DIR:
756756
p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c")
757-
f = open(p, "wb")
757+
f = open(p, "w")
758758
f.write(auto_gen_msg)
759759
f.write(c_file_msg % parse_version(mod))
760760
f.write('#include "Python.h"\n')

0 commit comments

Comments
 (0)