summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-10-16 15:24:04 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-10-16 15:24:32 -0700
commit087444cf4cf3302908c9bda34f488b005df0ea8c (patch)
tree126d2a2fc5aafb1f5b3c9c8b16a40bd1e29fb991
parent28fc70affdddb80731d1a151eb8a0049c2eb411f (diff)
Dropped Python 2.6 so we can stop using u()/b() for literals.
Sadly we (ab?)use them in many more places, but hey, every little bit counts
-rw-r--r--paramiko/sftp_server.py4
-rw-r--r--paramiko/util.py4
-rw-r--r--paramiko/win_pageant.py2
-rw-r--r--tests/test_util.py6
4 files changed, 8 insertions, 8 deletions
diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py
index f8c4f727..5980aadd 100644
--- a/paramiko/sftp_server.py
+++ b/paramiko/sftp_server.py
@@ -32,7 +32,7 @@ from paramiko.sftp import (
from paramiko.sftp_si import SFTPServerInterface
from paramiko.sftp_attr import SFTPAttributes
from paramiko.common import DEBUG
-from paramiko.py3compat import long, string_types, bytes_types, b
+from paramiko.py3compat import long, string_types, bytes_types
from paramiko.server import SubsystemHandler
@@ -209,7 +209,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler):
# must be error code
self._send_status(request_number, handle)
return
- handle._set_name(b('hx{:d}'.format(self.next_handle)))
+ handle._set_name(b'hx{:d}'.format(self.next_handle))
self.next_handle += 1
if folder:
self.folder_table[handle._get_name()] = handle
diff --git a/paramiko/util.py b/paramiko/util.py
index b056c20a..f72d429c 100644
--- a/paramiko/util.py
+++ b/paramiko/util.py
@@ -111,13 +111,13 @@ def format_binary_line(data):
def safe_string(s):
- out = b('')
+ out = b''
for c in s:
i = byte_ord(c)
if 32 <= i <= 127:
out += byte_chr(i)
else:
- out += b('%{:02X}'.format(i))
+ out += b'%{:02X}'.format(i)
return out
diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py
index fda3b9c1..661ba575 100644
--- a/paramiko/win_pageant.py
+++ b/paramiko/win_pageant.py
@@ -44,7 +44,7 @@ win32con_WM_COPYDATA = 74
def _get_pageant_window_object():
- return ctypes.windll.user32.FindWindowA(b('Pageant'), b('Pageant'))
+ return ctypes.windll.user32.FindWindowA(b'Pageant', b'Pageant')
def can_talk_to_agent():
diff --git a/tests/test_util.py b/tests/test_util.py
index dfb4b466..cb326ff7 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -469,11 +469,11 @@ Host param3 parara
self.assertRaises(Exception, conf._get_hosts, host)
def test_safe_string(self):
- vanilla = b("vanilla")
- has_bytes = b("has \7\3 bytes")
+ vanilla = b"vanilla"
+ has_bytes = b"has \7\3 bytes"
safe_vanilla = safe_string(vanilla)
safe_has_bytes = safe_string(has_bytes)
- expected_bytes = b("has %07%03 bytes")
+ expected_bytes = b"has %07%03 bytes"
err = "{!r} != {!r}"
msg = err.format(safe_vanilla, vanilla)
assert safe_vanilla == vanilla, msg