summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index e638d401..e5ee62c0 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -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')