diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2023-01-09 21:29:04 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2023-01-09 23:26:00 -0500 |
commit | 74eae059e2ae71044e31a580bc4ede1057c0053b (patch) | |
tree | 8c26afc3ce0c0c6494352791fd79b59ad222fb7f /paramiko/sftp_attr.py | |
parent | 4495c4054233c5f7b3c4ffb3fb52ca525bc0d983 (diff) | |
download | paramiko-74eae059e2ae71044e31a580bc4ede1057c0053b.tar.gz |
Remove py3compat.PY2, including related streamlining
Diffstat (limited to 'paramiko/sftp_attr.py')
-rw-r--r-- | paramiko/sftp_attr.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index 28a196b1..b1e3664e 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -19,7 +19,7 @@ import stat import time from paramiko.common import x80000000, o700, o70, xffffffff -from paramiko.py3compat import long, PY2, strftime +from paramiko.py3compat import long, strftime class SFTPAttributes(object): @@ -169,7 +169,7 @@ class SFTPAttributes(object): out += "-xSs"[suid + (n & 1)] return out - def _as_text(self): + def __str__(self): """create a unix-style long description of the file (like ls -l)""" if self.st_mode is not None: kind = stat.S_IFMT(self.st_mode) @@ -237,10 +237,4 @@ class SFTPAttributes(object): ) def asbytes(self): - return self._as_text().encode("utf-8") - - if PY2: - __unicode__ = _as_text - __str__ = asbytes - else: - __str__ = _as_text + return str(self).encode() |