diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-03-13 21:52:56 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-03-13 21:52:56 -0700 |
commit | a8ad23e61a25d4efaae938ed51228104b6096b14 (patch) | |
tree | 15cedf2fc26ac8d76747b1522ce604e8075e091b | |
parent | b94af130b590692c6cdc3312d3ff768e80ab077e (diff) | |
parent | 9ad2dec32a7cd9ba6c11969725e9512084d77e4a (diff) |
Merge branch '1.11' into 1.12
Conflicts:
sites/www/changelog.rst
-rw-r--r-- | paramiko/file.py | 2 | ||||
-rw-r--r-- | paramiko/server.py | 2 | ||||
-rw-r--r-- | paramiko/sftp_client.py | 2 | ||||
-rw-r--r-- | sites/www/changelog.rst | 3 |
4 files changed, 6 insertions, 3 deletions
diff --git a/paramiko/file.py b/paramiko/file.py index 253ffcd0..571ee6e9 100644 --- a/paramiko/file.py +++ b/paramiko/file.py @@ -436,7 +436,7 @@ class BufferedFile (object): return if self.newlines is None: self.newlines = newline - elif (type(self.newlines) is str) and (self.newlines != newline): + elif isinstance(self.newlines, basestring) and (self.newlines != newline): self.newlines = (self.newlines, newline) elif newline not in self.newlines: self.newlines += (newline,) diff --git a/paramiko/server.py b/paramiko/server.py index bf11cda3..bec08fc7 100644 --- a/paramiko/server.py +++ b/paramiko/server.py @@ -514,7 +514,7 @@ class InteractiveQuery (object): self.instructions = instructions self.prompts = [] for x in prompts: - if (type(x) is str) or (type(x) is unicode): + if isinstance(x, basestring): self.add_prompt(x) else: self.add_prompt(x[0], x[1]) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 0580bc43..13e830c4 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -660,7 +660,7 @@ class SFTPClient(BaseSFTP): msg.add_int(item) elif isinstance(item, long): msg.add_int64(item) - elif isinstance(item, str): + elif isinstance(item, basestring): msg.add_string(item) elif isinstance(item, SFTPAttributes): item._pack(msg) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 720d93af..eaf74441 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`235` Improve string type testing in a handful of spots (e.g. ``s/if + type(x) is str/if isinstance(x, basestring)/g``.) Thanks to ``@ksamuel`` for + the report. * :release:`1.12.3 <2014-03-13>` * :release:`1.11.5 <2014-03-13>` * :release:`1.10.7 <2014-03-13>` |