Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,11 +1912,8 @@ def read_stata(
if iterator or chunksize:
return reader

try:
data = reader.read()
finally:
reader.close()
return data
with reader:
return reader.read()


def _set_endianness(endianness: str) -> str:
Expand Down