[BACK]Return to patch-tools_xml2h.py CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / editors / medit / patches

File: [cvs.NetBSD.org] / pkgsrc / editors / medit / patches / patch-tools_xml2h.py (download)

Revision 1.1, Sun Apr 11 00:58:16 2021 UTC (21 months, 3 weeks ago) by tsutsui
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, HEAD

medit: apply mechanical patches to python scripts for python3. PR/56088

"If it works for you, please just commit it" from wiz@.

$NetBSD: patch-tools_xml2h.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $

- mechanical python3 support

--- tools/xml2h.py.orig	2012-12-16 23:55:32.000000000 +0000
+++ tools/xml2h.py
@@ -11,13 +11,13 @@ tmp_output = output + '.tmp'
 varname = sys.argv[3]
 
 outfile = open(tmp_output, 'w')
-print >> outfile, '/* -*- C -*- */'
-print >> outfile, 'static const char %s [] = ""' % (varname,)
+print('/* -*- C -*- */', file=outfile)
+print('static const char %s [] = ""' % (varname,), file=outfile)
 for line in open(input):
     if line.endswith('\n'):
         line = line[:-1]
-    print >> outfile, '"' + line.replace('"', '\\"') + '\\n"'
-print >> outfile, ';'
+    print('"' + line.replace('"', '\\"') + '\\n"', file=outfile)
+print(';', file=outfile)
 
 outfile.close()