From 83d1175c32a0638460b51cc8ce7eb1df3a4cf949 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Thu, 12 Jan 2023 16:30:59 -0500 Subject: Update a bunch of no/low impact python2/3 references/comments --- paramiko/util.py | 6 +++--- paramiko/win_pageant.py | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'paramiko') 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 -- cgit v1.2.1