Skip to content

Commit ce719fd

Browse files
authored
TYP: fix mypy ignored err in pandas/io/formats/format.py (pandas-dev#37739)
1 parent 0ddf563 commit ce719fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/io/formats/format.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1046,12 +1046,14 @@ def to_csv(
10461046
"""
10471047
from pandas.io.formats.csvs import CSVFormatter
10481048

1049-
created_buffer = path_or_buf is None
1050-
if created_buffer:
1049+
if path_or_buf is None:
1050+
created_buffer = True
10511051
path_or_buf = StringIO()
1052+
else:
1053+
created_buffer = False
10521054

10531055
csv_formatter = CSVFormatter(
1054-
path_or_buf=path_or_buf, # type: ignore[arg-type]
1056+
path_or_buf=path_or_buf,
10551057
line_terminator=line_terminator,
10561058
sep=sep,
10571059
encoding=encoding,

0 commit comments

Comments
 (0)