Skip to content

Commit 3afa1db

Browse files
committed
Expand history file path only once
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent d441dd5 commit 3afa1db

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bpython/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def get_key_no_doublebind(attr, already_used={}):
229229
for key in (struct.pastebin_key, struct.save_key):
230230
key_dispatch[key]
231231

232+
struct.hist_file = os.path.expanduser(struct.hist_file)
233+
232234
def load_theme(struct, path, colors, default_colors):
233235
theme = ConfigParser()
234236
with open(path, 'r') as f:

bpython/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ def push(self, s, insert_into_history=True):
890890

891891
def insert_into_history(self, s):
892892
if self.config.hist_length:
893-
histfilename = os.path.expanduser(self.config.hist_file)
893+
histfilename = self.config.hist_file
894894
oldhistory = self.rl_history.entries
895895
self.rl_history.entries = []
896896
if os.path.exists(histfilename):

0 commit comments

Comments
 (0)