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_issue_template.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'devscripts/make_issue_template.py') diff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.py index b7ad23d83..65fa8169f 100644 --- a/devscripts/make_issue_template.py +++ b/devscripts/make_issue_template.py @@ -1,8 +1,11 @@ #!/usr/bin/env python from __future__ import unicode_literals -import io import optparse +import os.path +import sys + +from utils import read_file, read_version, write_file def main(): @@ -13,17 +16,11 @@ def main(): infile, outfile = args - with io.open(infile, encoding='utf-8') as inf: - issue_template_tmpl = inf.read() - - # Get the version from youtube_dl/version.py without importing the package - exec(compile(open('youtube_dl/version.py').read(), - 'youtube_dl/version.py', 'exec')) + issue_template_tmpl = read_file(infile) - out = issue_template_tmpl % {'version': locals()['__version__']} + out = issue_template_tmpl % {'version': read_version()} - with io.open(outfile, 'w', encoding='utf-8') as outf: - outf.write(out) + write_file(outfile, out) if __name__ == '__main__': main() -- cgit v1.2.3