summaryrefslogtreecommitdiff
path: root/paramiko/rsakey.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2023-01-09 21:29:04 -0500
committerJeff Forcier <jeff@bitprophet.org>2023-01-09 23:26:00 -0500
commit74eae059e2ae71044e31a580bc4ede1057c0053b (patch)
tree8c26afc3ce0c0c6494352791fd79b59ad222fb7f /paramiko/rsakey.py
parent4495c4054233c5f7b3c4ffb3fb52ca525bc0d983 (diff)
downloadparamiko-74eae059e2ae71044e31a580bc4ede1057c0053b.tar.gz
Remove py3compat.PY2, including related streamlining
Diffstat (limited to 'paramiko/rsakey.py')
-rw-r--r--paramiko/rsakey.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py
index a53daea4..9ea00e95 100644
--- a/paramiko/rsakey.py
+++ b/paramiko/rsakey.py
@@ -27,7 +27,6 @@ from cryptography.hazmat.primitives.asymmetric import rsa, padding
from paramiko.message import Message
from paramiko.pkey import PKey
-from paramiko.py3compat import PY2
from paramiko.ssh_exception import SSHException
@@ -98,16 +97,9 @@ class RSAKey(PKey):
return m.asbytes()
def __str__(self):
- # NOTE: as per inane commentary in #853, this appears to be the least
- # crummy way to get a representation that prints identical to Python
- # 2's previous behavior, on both interpreters.
- # TODO: replace with a nice clean fingerprint display or something
- if PY2:
- # Can't just return the .decode below for Py2 because stuff still
- # tries stuffing it into ASCII for whatever godforsaken reason
- return self.asbytes()
- else:
- return self.asbytes().decode("utf8", errors="ignore")
+ # NOTE: see #853 to explain some legacy behavior.
+ # TODO 4.0: replace with a nice clean fingerprint display or something
+ return self.asbytes().decode("utf8", errors="ignore")
@property
def _fields(self):