Skip to content

Commit 223ce7d

Browse files
authored
Don't use context manager with pathlib object... (#77)
Fixes #74
1 parent 88e6fee commit 223ce7d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

trepan/inout/ptk_bindkeys.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2024 Rocky Bernstein <rocky@gnu.org>
2+
# Copyright (C) 2024-2025 Rocky Bernstein <rocky@gnu.org>
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -37,12 +37,11 @@ def read_inputrc(read_init_file_fn: Callable, use_unicode: bool) -> None:
3737
# GNU Readline inputrc $include's paths are relative to itself,
3838
# so chdir to its directory before reading the file.
3939
parent_dir = pathlib.Path(__file__).parent.absolute()
40-
with parent_dir:
41-
inputrc = "inputrc-unicode" if use_unicode else "inputrc-no-unicode"
42-
try:
43-
read_init_file_fn(str(parent_dir / "data" / inputrc))
44-
except Exception:
45-
pass
40+
inputrc = "inputrc-unicode" if use_unicode else "inputrc-no-unicode"
41+
try:
42+
read_init_file_fn(str(parent_dir / "data" / inputrc))
43+
except Exception:
44+
pass
4645

4746

4847
def read_init_file(path: str):

0 commit comments

Comments
 (0)