Skip to content

Commit

Permalink
Address no-any-return errors
Browse files Browse the repository at this point in the history
src/twisted/test/iosim.py:63:66: error: Returning Any from function declared to return "object"  [no-any-return]
        _nextserial = staticmethod(lambda counter=itertools.count(): next(counter))

src/twisted/cred/test/test_cred.py:364:42: error: Returning Any from function declared to return "object"  [no-any-return]
        networkHash = staticmethod(lambda x: x)
  • Loading branch information
twm committed Dec 28, 2021
1 parent 18a7cb3 commit 7caec44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/twisted/cred/test/test_cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def test_negative(self):
class HashlessFilePasswordDBMixin:
credClass = credentials.UsernamePassword
diskHash = None
networkHash = staticmethod(lambda x: x)

@staticmethod
def networkHash(x: bytes) -> bytes:
return x

_validCredentials = [
(b"user1", b"password1"),
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/test/iosim.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class FakeTransport:
and is thus useful mainly as a utility for debugging protocols.
"""

_nextserial = staticmethod(lambda counter=itertools.count(): next(counter))
_nextserial = staticmethod(lambda counter=itertools.count(): int(next(counter)))
closed = 0
disconnecting = 0
disconnected = 0
Expand Down

0 comments on commit 7caec44

Please sign in to comment.