Skip to content

Commit 3ffe89f

Browse files
Merge pull request #163 from BoboTiG/fix-remove-deprecated-ioerror
fix: replace usage of `IOError` with `OSError`
2 parents 3f55b2d + deda7ba commit 3ffe89f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

icalevents/icaldownload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ def data_from_file(self, file, apple_fix=False):
8080
content = f.read()
8181

8282
if not content:
83-
raise IOError("File %s is not readable or is empty!" % file)
83+
raise OSError("File %s is not readable or is empty!" % file)
8484

8585
return self.decode(content, apple_fix=apple_fix)
8686

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

9191
return self.decode(string_content, apple_fix=apple_fix)
9292

test/test_icaldownload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_data_from_file_apple(self):
7474
def test_empty_file(self):
7575
empty_ical = "test/test_data/empty.ics"
7676

77-
with self.assertRaises(IOError) as cm:
77+
with self.assertRaises(OSError) as cm:
7878
icalevents.icaldownload.ICalDownload().data_from_file(empty_ical)
7979

8080
self.assertEqual(

0 commit comments

Comments
 (0)