@@ -110,7 +110,7 @@ cdef class Session:
110110 return
111111 return Channel.from_ptr(_channel, self )
112112
113- def cancel_forward (self , address , int port ):
113+ def cancel_forward (self , address not None , int port ):
114114 cdef bytes b_address = to_bytes(address)
115115 cdef char * c_address = b_address
116116 cdef int rc
@@ -119,7 +119,7 @@ cdef class Session:
119119 self ._session, c_address, port)
120120 return handle_ssh_error_codes(rc, self ._session)
121121
122- def listen_forward (self , address , int port , int bound_port ):
122+ def listen_forward (self , address not None , int port , int bound_port ):
123123 cdef bytes b_address = to_bytes(address)
124124 cdef char * c_address = b_address
125125 cdef int rc
@@ -338,23 +338,23 @@ cdef class Session:
338338 rc = c_ssh.ssh_userauth_list(self ._session, NULL )
339339 return handle_ssh_error_codes(rc, self ._session)
340340
341- def userauth_try_publickey (self , SSHKey pubkey ):
341+ def userauth_try_publickey (self , SSHKey pubkey not None ):
342342 cdef int rc
343343 with nogil:
344344 _check_connected(self ._session)
345345 rc = c_ssh.ssh_userauth_try_publickey(
346346 self ._session, NULL , pubkey._key)
347347 return handle_auth_error_codes(rc, self ._session)
348348
349- def userauth_publickey (self , SSHKey privkey ):
349+ def userauth_publickey (self , SSHKey privkey not None ):
350350 cdef int rc
351351 with nogil:
352352 _check_connected(self ._session)
353353 rc = c_ssh.ssh_userauth_publickey(
354354 self ._session, NULL , privkey._key)
355355 return handle_auth_error_codes(rc, self ._session)
356356
357- def userauth_agent (self , username ):
357+ def userauth_agent (self , username not None ):
358358 cdef bytes b_username = to_bytes(username)
359359 cdef char * c_username = b_username
360360 cdef int rc
@@ -363,7 +363,7 @@ cdef class Session:
363363 rc = c_ssh.ssh_userauth_agent(self ._session, c_username)
364364 return handle_ssh_error_codes(rc, self ._session)
365365
366- def userauth_publickey_auto (self , passphrase ):
366+ def userauth_publickey_auto (self , passphrase not None ):
367367 cdef bytes b_passphrase = to_bytes(passphrase)
368368 cdef char * c_passphrase = b_passphrase
369369 cdef int rc
@@ -373,7 +373,7 @@ cdef class Session:
373373 self ._session, NULL , c_passphrase)
374374 return handle_ssh_error_codes(rc, self ._session)
375375
376- def userauth_password (self , username , password ):
376+ def userauth_password (self , username not None , password not None ):
377377 cdef bytes b_username = to_bytes(username)
378378 cdef bytes b_password = to_bytes(password)
379379 cdef char * c_username = b_username
@@ -385,7 +385,7 @@ cdef class Session:
385385 self ._session, c_username, c_password)
386386 return handle_ssh_error_codes(rc, self ._session)
387387
388- def userauth_kbdint (self , username , submethods ):
388+ def userauth_kbdint (self , username not None , submethods not None ):
389389 cdef bytes b_username = to_bytes(username)
390390 cdef bytes b_submethods = to_bytes(submethods)
391391 cdef char * c_username = b_username
0 commit comments