opts.py: avoid use of os.path.expanduser()

- MSYS2 Python expands the tilde to $HOMEPATH instead of $HOME, rendering this
  function useless.
This commit is contained in:
The MMGen Project 2021-10-10 20:18:14 +00:00
commit e5a6fa588a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -276,7 +276,7 @@ def init(opts_data=None,add_opts=None,init_opts=None,opt_filter=None,parse_only=
finalized before setting data_dir
"""
if opt.data_dir:
g.data_dir_root = os.path.normpath(os.path.expanduser(opt.data_dir))
g.data_dir_root = os.path.normpath(os.path.abspath(opt.data_dir))
elif os.getenv('MMGEN_TEST_SUITE'):
from test.include.common import get_data_dir
g.data_dir_root = get_data_dir()