Skip to content

Commit fdebfb4

Browse files
committed
Revert "Added checking for socket before attempting to get session methods. Added test."
This reverts commit a2f0caf.
1 parent 9e898f4 commit fdebfb4

File tree

3 files changed

+52
-92
lines changed

3 files changed

+52
-92
lines changed

ssh2/session.c

Lines changed: 50 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/session.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ cdef class Session:
180180
return bool(rc)
181181

182182
def userauth_list(self, username not None):
183-
"""Retrieve available authentication methodslist.
183+
"""Retrieve available authentication methods list.
184184
185185
:rtype: list"""
186186
cdef bytes b_username = to_bytes(username)
@@ -762,8 +762,6 @@ cdef class Session:
762762
763763
:rtype: str
764764
"""
765-
if not self.sock:
766-
return
767765
with nogil:
768766
methods = c_ssh2.libssh2_session_methods(
769767
self._session, method_type.value)

tests/test_session.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ssh2.session import Session, LIBSSH2_METHOD_HOSTKEY
1+
from ssh2.session import Session
22

33
from .base_test import SSH2TestCase
44

@@ -7,8 +7,3 @@ class SessionTestCase(SSH2TestCase):
77
def test_session(self):
88
session = Session()
99
self.assertIsInstance(session, Session)
10-
11-
def test_methods(self):
12-
session = Session()
13-
methods = session.methods(LIBSSH2_METHOD_HOSTKEY)
14-
self.assertIsNone(methods)

0 commit comments

Comments
 (0)