From c1180767415bf5f51aa275c6bf11853e98d729c0 Mon Sep 17 00:00:00 2001 From: HarshDaryani896 <82017686+HarshDaryani896@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:30:25 +0530 Subject: [PATCH] Added `os.path.expanduser` (#22) --- bin/ycqlsh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ycqlsh.py b/bin/ycqlsh.py index 73966f2..17eec18 100755 --- a/bin/ycqlsh.py +++ b/bin/ycqlsh.py @@ -277,10 +277,10 @@ def resolve_cql_history_file(): except OSError: print('\nWarning: Cannot create directory at `%s`. Command history will not be saved. Please check what was the environment property CQL_HISTORY set to.\n' % HISTORY_DIR) -DEFAULT_CQLSHRC = os.path.join('~', '.cassandra', 'cqlshrc') +DEFAULT_CQLSHRC = os.path.expanduser(os.path.join('~', '.cassandra', 'cqlshrc')) if hasattr(options, 'cqlshrc'): - CONFIG_FILE = options.cqlshrc + CONFIG_FILE = os.path.expanduser(options.cqlshrc) if not os.path.exists(CONFIG_FILE): print('\nWarning: Specified cqlshrc location `%s` does not exist. Using `%s` instead.\n' % (CONFIG_FILE, DEFAULT_CQLSHRC)) CONFIG_FILE = DEFAULT_CQLSHRC