Skip to content

Commit

Permalink
Merge pull request #252 from hugovk/replace-deprecated-BadZipfile
Browse files Browse the repository at this point in the history
Replace deprecated BadZipfile with BadZipFile
  • Loading branch information
dilshod authored Mar 13, 2023
2 parents 3180d94 + 12682f5 commit 140e4cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xlsx2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __init__(self, xlsxfile, **options):
self.options = options
try:
self.ziphandle = zipfile.ZipFile(xlsxfile)
except (zipfile.BadZipfile, IOError):
except (zipfile.BadZipFile, IOError):
raise InvalidXlsxFileException("Invalid xlsx file: " + str(xlsxfile))

self.py3 = sys.version_info[0] == 3
Expand Down Expand Up @@ -1038,7 +1038,7 @@ def convert_recursive(path, sheetid, outfile, kwargs):
print("Converting %s to %s" % (fullpath, outfilepath))
try:
Xlsx2csv(fullpath, **kwargs).convert(outfilepath, sheetid)
except zipfile.BadZipfile:
except zipfile.BadZipFile:
raise InvalidXlsxFileException("File %s is not a zip file" % fullpath)


Expand Down

0 comments on commit 140e4cf

Please sign in to comment.