about summary refs log tree commit diff
path: root/devscripts/make_contributing.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-07-25 00:22:54 +0100
committerdirkf <fieldhouse@gmx.net>2023-07-25 13:19:43 +0100
commitb87018122995acb7e6a1be3f2464605259b93611 (patch)
tree11f47d8a9d8e32e04cf5eca2fa9c82448fff49e9 /devscripts/make_contributing.py
parenta25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (diff)
downloadyoutube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.gz
youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.xz
youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.zip
[build] Extend use of `devscripts/utils`
Diffstat (limited to 'devscripts/make_contributing.py')
-rwxr-xr-xdevscripts/make_contributing.py9
1 files changed, 4 insertions, 5 deletions
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__':