diff options
author | dirkf <fieldhouse@gmx.net> | 2023-07-25 00:22:54 +0100 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2023-07-25 13:19:43 +0100 |
commit | b87018122995acb7e6a1be3f2464605259b93611 (patch) | |
tree | 11f47d8a9d8e32e04cf5eca2fa9c82448fff49e9 /devscripts/create-github-release.py | |
parent | a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (diff) | |
download | youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.gz youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.xz youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.zip |
[build] Extend use of `devscripts/utils`
Diffstat (limited to 'devscripts/create-github-release.py')
-rw-r--r-- | devscripts/create-github-release.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/devscripts/create-github-release.py b/devscripts/create-github-release.py index 2ddfa1096..320bcfc27 100644 --- a/devscripts/create-github-release.py +++ b/devscripts/create-github-release.py @@ -1,7 +1,6 @@ #!/usr/bin/env python from __future__ import unicode_literals -import io import json import mimetypes import netrc @@ -10,7 +9,9 @@ import os import re import sys -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +dirn = os.path.dirname + +sys.path.insert(0, dirn(dirn(os.path.abspath(__file__)))) from youtube_dl.compat import ( compat_basestring, @@ -22,6 +23,7 @@ from youtube_dl.utils import ( make_HTTPS_handler, sanitized_Request, ) +from utils import read_file class GitHubReleaser(object): @@ -89,8 +91,7 @@ def main(): changelog_file, version, build_path = args - with io.open(changelog_file, encoding='utf-8') as inf: - changelog = inf.read() + changelog = read_file(changelog_file) mobj = re.search(r'(?s)version %s\n{2}(.+?)\n{3}' % version, changelog) body = mobj.group(1) if mobj else '' |