Skip to content

Commit

Permalink
Fixed NameError instead of TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnl committed Dec 12, 2021
1 parent f516620 commit 76d4421
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jsonc_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __re_sub(match):
filepath = os.fspath(filepath)
except TypeError:
raise FunctionParameterError(
"filepath parameter must be path-like; got {} instead".format(type(path).__name__)
"filepath parameter must be path-like; got {} instead".format(type(filepath).__name__)
)

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

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

if not filepath:
Expand Down

0 comments on commit 76d4421

Please sign in to comment.