Skip to content

Commit 76d4421

Browse files
committed
Fixed NameError instead of TypeError
1 parent f516620 commit 76d4421

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jsonc_parser/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __re_sub(match):
6767
filepath = os.fspath(filepath)
6868
except TypeError:
6969
raise FunctionParameterError(
70-
"filepath parameter must be path-like; got {} instead".format(type(path).__name__)
70+
"filepath parameter must be path-like; got {} instead".format(type(filepath).__name__)
7171
)
7272

7373
if not filepath:
@@ -109,7 +109,7 @@ def convert_to_json(filepath: Union[str, os.PathLike], remove_file: bool = False
109109
filepath = os.fspath(filepath)
110110
except TypeError:
111111
raise FunctionParameterError(
112-
"filepath parameter must be path-like; got {} instead".format(type(path).__name__)
112+
"filepath parameter must be path-like; got {} instead".format(type(filepath).__name__)
113113
)
114114

115115
if not filepath:
@@ -153,7 +153,7 @@ def convert_to_jsonc(filepath: Union[str, os.PathLike], remove_file: bool = Fals
153153
filepath = os.fspath(filepath)
154154
except TypeError:
155155
raise FunctionParameterError(
156-
"filepath parameter must be path-like; got {} instead".format(type(path).__name__)
156+
"filepath parameter must be path-like; got {} instead".format(type(filepath).__name__)
157157
)
158158

159159
if not filepath:

0 commit comments

Comments
 (0)