From b87018122995acb7e6a1be3f2464605259b93611 Mon Sep 17 00:00:00 2001 From: dirkf Date: Tue, 25 Jul 2023 00:22:54 +0100 Subject: [build] Extend use of `devscripts/utils` --- devscripts/make_contributing.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'devscripts/make_contributing.py') diff --git a/devscripts/make_contributing.py b/devscripts/make_contributing.py index 226d1a5d6..5a9eb194f 100755 --- a/devscripts/make_contributing.py +++ b/devscripts/make_contributing.py @@ -1,10 +1,11 @@ #!/usr/bin/env python from __future__ import unicode_literals -import io import optparse import re +from utils import read_file, write_file + def main(): parser = optparse.OptionParser(usage='%prog INFILE OUTFILE') @@ -14,8 +15,7 @@ def main(): infile, outfile = args - with io.open(infile, encoding='utf-8') as inf: - readme = inf.read() + readme = read_file(infile) bug_text = re.search( r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1) @@ -25,8 +25,7 @@ def main(): out = bug_text + dev_text - with io.open(outfile, 'w', encoding='utf-8') as outf: - outf.write(out) + write_file(outfile, out) if __name__ == '__main__': -- cgit v1.2.3