Add maxlen argument to ErrorNetworkReply.readData.
This was missing before, causing a (hidden) exception with Python < 3.5, and this with 3.5: TypeError: readData() takes 1 positional argument but 2 were given During handling of the above exception, another exception occurred: SystemError: PyEval_EvalFrameEx returned a result with an error set Fixes #969.
This commit is contained in:
parent
5db4ed0ed1
commit
11961db72c
@ -127,7 +127,7 @@ class ErrorNetworkReply(QNetworkReply):
|
||||
"""We always have 0 bytes available."""
|
||||
return 0
|
||||
|
||||
def readData(self):
|
||||
def readData(self, _maxlen):
|
||||
"""No data available."""
|
||||
return bytes()
|
||||
|
||||
|
@ -88,6 +88,6 @@ def test_error_network_reply(qtbot, req):
|
||||
assert reply.isFinished()
|
||||
assert not reply.isRunning()
|
||||
assert reply.bytesAvailable() == 0
|
||||
assert reply.readData() == b''
|
||||
assert reply.readData(1) == b''
|
||||
assert reply.error() == QNetworkReply.UnknownNetworkError
|
||||
assert reply.errorString() == "This is an error"
|
||||
|
Loading…
Reference in New Issue
Block a user