Skip to content

Commit

Permalink
Fixes other issue with pandas handles
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelduchesne committed Feb 11, 2021
1 parent a62190f commit e4a775a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyTrnsysType/deck.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ def __init__(self, obj, path_or_buf, encoding=None, mode="w"):

if path_or_buf is None:
path_or_buf = StringIO()
self.path_or_buf, _, _, _ = _get_filepath_or_buffer(
io_args = _get_filepath_or_buffer(
path_or_buf, encoding=encoding, compression=None, mode=mode
)
self.path_or_buf = io_args.filepath_or_buffer
self.obj = obj
self.mode = mode
if encoding is None:
Expand All @@ -67,12 +68,14 @@ def save(self):
f = self.path_or_buf
close = False
else:
f, handles = get_handle(
io_handles = get_handle(
self.path_or_buf,
self.mode,
encoding=self.encoding,
compression=None,
)
f = io_handles.handle
handles = io_handles.created_handles
close = True
try:
deck_str = str(self.obj)
Expand Down

0 comments on commit e4a775a

Please sign in to comment.