diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-10 21:45:21 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-10 21:45:21 -0400 |
| commit | 839646c947c2be134dfc054222ec4e1a490b6259 (patch) | |
| tree | 4ea36cab021f0fb3308859b1cd3366f454acc760 | |
| parent | 08cee23ec10f22da1eb54944c8e01564c16a5c33 (diff) | |
| download | cmd2-git-839646c947c2be134dfc054222ec4e1a490b6259.tar.gz | |
Minor attempt at ruggedization of clipboard stuff in some weird cases on Python 2
| -rwxr-xr-x | cmd2.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -319,7 +319,8 @@ def get_paste_buffer(): """ pb_str = pyperclip.paste() - if six.PY2: + # If value returned from the clipboard is unicode and this is Python 2, convert to a "normal" Python 2 string first + if six.PY2 and not isinstance(pb_str, str): import unicodedata pb_str = unicodedata.normalize('NFKD', pb_str).encode('ascii', 'ignore') |
