Skip to content

Commit

Permalink
catch zip
Browse files Browse the repository at this point in the history
  • Loading branch information
minggli committed Jun 14, 2018
1 parent 6accf04 commit 0da6c41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pandas/io/formats/csvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import print_function

import csv as csvlib
from zipfile import ZipFile
import numpy as np

from pandas.core.dtypes.missing import notna
Expand Down Expand Up @@ -127,8 +128,9 @@ def save(self):
else:
encoding = self.encoding

if (not hasattr(self.path_or_buf, 'write') and
self.compression == 'zip'):
if (isinstance(self.path_or_buf, ZipFile) or
(not hasattr(self.path_or_buf, 'write') and
self.compression == 'zip')):
is_zip = True
else:
is_zip = False
Expand Down

0 comments on commit 0da6c41

Please sign in to comment.