summaryrefslogtreecommitdiff
path: root/paramiko
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2023-01-12 16:30:59 -0500
committerJeff Forcier <jeff@bitprophet.org>2023-01-12 21:44:59 -0500
commit83d1175c32a0638460b51cc8ce7eb1df3a4cf949 (patch)
tree7e940bc4bc7e10052493753c814a564a8b25d043 /paramiko
parent027728e17b31fb3ee685733c8b39a06b57158849 (diff)
downloadparamiko-83d1175c32a0638460b51cc8ce7eb1df3a4cf949.tar.gz
Update a bunch of no/low impact python2/3 references/comments
Diffstat (limited to 'paramiko')
-rw-r--r--paramiko/util.py6
-rw-r--r--paramiko/win_pageant.py5
2 files changed, 4 insertions, 7 deletions
diff --git a/paramiko/util.py b/paramiko/util.py
index 5a21977e..2c6287b6 100644
--- a/paramiko/util.py
+++ b/paramiko/util.py
@@ -312,12 +312,12 @@ def asbytes(s):
"""
try:
# Attempt to run through our version of b(), which does the Right Thing
- # for string/unicode/buffer (Py2) or bytes/str (Py3), and raises
- # TypeError if it's not one of those types.
+ # for unicode strings vs bytestrings, and raises TypeError if it's not
+ # one of those types.
return b(s)
except TypeError:
try:
- # If it wasn't a string/byte/buffer type object, try calling an
+ # If it wasn't a string/byte/buffer-ish object, try calling an
# asbytes() method, which many of our internal classes implement.
return s.asbytes()
except AttributeError:
diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py
index a1096ee8..780824c1 100644
--- a/paramiko/win_pageant.py
+++ b/paramiko/win_pageant.py
@@ -28,10 +28,7 @@ import struct
from paramiko.common import zero_byte
from paramiko.util import b
-try:
- import _thread as thread # Python 3.x
-except ImportError:
- import thread # Python 2.5-2.7
+import _thread as thread
from . import _winapi