Skip to content

Commit

Permalink
refactor: replace IOError with OSError
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kwsm committed Aug 19, 2024
1 parent 903792f commit c4646e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gunicorn/http/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ParseException(Exception):
pass


class NoMoreData(IOError):
class NoMoreData(OSError):
def __init__(self, buf=None):
self.buf = buf

Expand Down Expand Up @@ -89,15 +89,15 @@ def __str__(self):
return "Unsupported transfer coding: %r" % self.hdr


class InvalidChunkSize(IOError):
class InvalidChunkSize(OSError):
def __init__(self, data):
self.data = data

def __str__(self):
return "Invalid chunk size: %r" % self.data


class ChunkMissingTerminator(IOError):
class ChunkMissingTerminator(OSError):
def __init__(self, term):
self.term = term

Expand Down
2 changes: 1 addition & 1 deletion tests/test_pidfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def builtin(name):
@mock.patch(builtin('open'), new_callable=mock.mock_open)
def test_validate_no_file(_open):
pidfile = gunicorn.pidfile.Pidfile('test.pid')
_open.side_effect = IOError(errno.ENOENT)
_open.side_effect = OSError(errno.ENOENT)
assert pidfile.validate() is None


Expand Down

0 comments on commit c4646e3

Please sign in to comment.