about summary refs log tree commit diff
path: root/devscripts/make_issue_template.py
diff options
context:
space:
mode:
Diffstat (limited to 'devscripts/make_issue_template.py')
-rw-r--r--devscripts/make_issue_template.py17
1 files changed, 7 insertions, 10 deletions
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()