Skip to content

Commit

Permalink
STY - Add repr to html.py and parsers.py - pandas-dev#29953
Browse files Browse the repository at this point in the history
  • Loading branch information
JvPy committed Dec 5, 2019
1 parent 04c0870 commit 4ea03fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _get_skiprows(skiprows):
elif skiprows is None:
return 0
raise TypeError(
"%r is not a valid type for skipping rows" % type(skiprows).__name__
f"{repr(type(skiprows).__name__)} is not a valid type for skipping rows"
)


Expand Down Expand Up @@ -133,7 +133,7 @@ def _read(obj):
except (TypeError, ValueError):
pass
else:
raise TypeError("Cannot read object of type %r" % type(obj).__name__)
raise TypeError(f"Cannot read object of type {type(obj).__name__}")
return text


Expand Down
8 changes: 4 additions & 4 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,8 @@ def _get_options_with_defaults(self, engine):
pass
else:
raise ValueError(
"The %r option is not supported with the"
" %r engine" % (argname, engine)
f"The {repr(argname)} option is not supported with the"
f" {repr(engine)} engine"
)
else:
value = _deprecated_defaults.get(argname, default)
Expand Down Expand Up @@ -3607,8 +3607,8 @@ def __init__(self, f, colspecs, delimiter, comment, skiprows=None, infer_nrows=1

if not isinstance(self.colspecs, (tuple, list)):
raise TypeError(
"column specifications must be a list or tuple, "
"input was a %r" % type(colspecs).__name__
f"column specifications must be a list or tuple, "
f"input was a {repr(type(colspecs).__name__)}"
)

for colspec in self.colspecs:
Expand Down

0 comments on commit 4ea03fc

Please sign in to comment.