Skip to content

Commit 5ffb1da

Browse files
committed
Drop support for Python version below 3.8
1 parent bb2fba3 commit 5ffb1da

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.travis.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ dist: xenial
22
language: python
33

44
python:
5-
- "2.7"
6-
- "3.4"
7-
- "3.5"
8-
- "3.6"
9-
- "3.7"
105
- "3.8"
116
- "3.9"
127

138
install:
149
- pip install -r requirements.txt
15-
- pip install 'pytest>=4.6' pytest-cov codecov flake8
16-
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install mock; fi
10+
- pip install pytest pytest-cov codecov flake8
1711

1812
script:
1913
- pytest --cov=webssh

requirements.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
paramiko==2.10.4
2-
tornado==5.1.1; python_version < '3.5'
3-
tornado==6.1.0; python_version >= '3.5'
1+
paramiko==3.0.0
2+
tornado==6.2.0

tests/sshserver.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import base64
12
import random
23
import socket
34
# import sys
@@ -6,7 +7,6 @@
67
import paramiko
78

89
from binascii import hexlify
9-
from paramiko.py3compat import u, decodebytes
1010
from tests.utils import make_tests_data_path
1111

1212

@@ -16,7 +16,7 @@
1616
host_key = paramiko.RSAKey(filename=make_tests_data_path('test_rsa.key'))
1717
# host_key = paramiko.DSSKey(filename='test_dss.key')
1818

19-
print('Read key: ' + u(hexlify(host_key.get_fingerprint())))
19+
print('Read key: ' + hexlify(host_key.get_fingerprint()).decode('utf-8'))
2020

2121
banner = u'\r\n\u6b22\u8fce\r\n'
2222
event_timeout = 5
@@ -29,7 +29,7 @@ class Server(paramiko.ServerInterface):
2929
b'fAu7jJ2d7eothvfeuoRFtJwhUmZDluRdFyhFY/hFAh76PJKGAusIqIQKlkJxMC'
3030
b'KDqIexkgHAfID/6mqvmnSJf0b5W8v5h2pI/stOSwTQ+pxVhwJ9ctYDhRSlF0iT'
3131
b'UWT10hcuO4Ks8=')
32-
good_pub_key = paramiko.RSAKey(data=decodebytes(data))
32+
good_pub_key = paramiko.RSAKey(data=base64.decodebytes(data))
3333

3434
commands = [
3535
b'$SHELL -ilc "locale charmap"',
@@ -62,7 +62,7 @@ def check_auth_password(self, username, password):
6262
return paramiko.AUTH_FAILED
6363

6464
def check_auth_publickey(self, username, key):
65-
print('Auth attempt with username: {!r} & key: {!r}'.format(username, u(hexlify(key.get_fingerprint())))) # noqa
65+
print('Auth attempt with username: {!r} & key: {!r}'.format(username, hexlify(key.get_fingerprint()).decode('utf-8'))) # noqa
6666
if (username in ['robey', 'keyonly']) and (key == self.good_pub_key):
6767
return paramiko.AUTH_SUCCESSFUL
6868
if username == 'pkey2fa' and key == self.good_pub_key:

0 commit comments

Comments
 (0)