diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | paramiko/sftp_client.py | 8 |
2 files changed, 7 insertions, 4 deletions
@@ -4,6 +4,9 @@ Temporary, post-Paramiko changelog while we get our sh!t together. * #15: Implemented parameter substitution in SSHConfig, matching the implementation of `ssh_config(5)`. Thanks to Olle Lundberg for the patch. +* #24: Switch some internal type checking to use `isinstance` to help prevent + problems with client libraries using subclasses of builtin types. Thanks to + Alex Morega for the patch. ## ssh 1.7.13 (2012-02-13) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 79a77614..f446ba3d 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -641,13 +641,13 @@ class SFTPClient (BaseSFTP): msg = Message() msg.add_int(self.request_number) for item in arg: - if type(item) is int: + if isinstance(item, int): msg.add_int(item) - elif type(item) is long: + elif isinstance(item, long): msg.add_int64(item) - elif type(item) is str: + elif isinstance(item, str): msg.add_string(item) - elif type(item) is SFTPAttributes: + elif isinstance(item, SFTPAttributes): item._pack(msg) else: raise Exception('unknown type for %r type %r' % (item, type(item))) |