Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace usage of IOError with OSError #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions icalevents/icaldownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
content = f.read()

if not content:
raise IOError("File %s is not readable or is empty!" % file)
raise OSError("File %s is not readable or is empty!" % file)

return self.decode(content, apple_fix=apple_fix)

def data_from_string(self, string_content, apple_fix=False):
if not string_content:
raise IOError("String content is not readable or is empty!")
raise OSError("String content is not readable or is empty!")

Check warning on line 89 in icalevents/icaldownload.py

View check run for this annotation

Codecov / codecov/patch

icalevents/icaldownload.py#L89

Added line #L89 was not covered by tests

return self.decode(string_content, apple_fix=apple_fix)

Expand Down
2 changes: 1 addition & 1 deletion test/test_icaldownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_data_from_file_apple(self):
def test_empty_file(self):
empty_ical = "test/test_data/empty.ics"

with self.assertRaises(IOError) as cm:
with self.assertRaises(OSError) as cm:
icalevents.icaldownload.ICalDownload().data_from_file(empty_ical)

self.assertEqual(
Expand Down