diff options
Diffstat (limited to 'release/util.py')
| -rw-r--r-- | release/util.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/release/util.py b/release/util.py index c839b872..8596324f 100644 --- a/release/util.py +++ b/release/util.py | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | """Random utility code for release tools.""" | 15 | """Random utility code for release tools.""" |
| 16 | 16 | ||
| 17 | import os | 17 | from pathlib import Path |
| 18 | import re | 18 | import re |
| 19 | import shlex | 19 | import shlex |
| 20 | import subprocess | 20 | import subprocess |
| @@ -24,8 +24,9 @@ import sys | |||
| 24 | assert sys.version_info >= (3, 6), "This module requires Python 3.6+" | 24 | assert sys.version_info >= (3, 6), "This module requires Python 3.6+" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | TOPDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 27 | THIS_FILE = Path(__file__).resolve() |
| 28 | HOMEDIR = os.path.expanduser("~") | 28 | TOPDIR = THIS_FILE.parent.parent |
| 29 | HOMEDIR = Path("~").expanduser() | ||
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | # These are the release keys we sign with. | 32 | # These are the release keys we sign with. |
| @@ -54,7 +55,7 @@ def run(opts, cmd, check=True, **kwargs): | |||
| 54 | def import_release_key(opts): | 55 | def import_release_key(opts): |
| 55 | """Import the public key of the official release repo signing key.""" | 56 | """Import the public key of the official release repo signing key.""" |
| 56 | # Extract the key from our repo launcher. | 57 | # Extract the key from our repo launcher. |
| 57 | launcher = getattr(opts, "launcher", os.path.join(TOPDIR, "repo")) | 58 | launcher = getattr(opts, "launcher", TOPDIR / "repo") |
| 58 | print(f'Importing keys from "{launcher}" launcher script') | 59 | print(f'Importing keys from "{launcher}" launcher script') |
| 59 | with open(launcher, encoding="utf-8") as fp: | 60 | with open(launcher, encoding="utf-8") as fp: |
| 60 | data = fp.read() | 61 | data = fp.read() |
