Show More
@@ -32,15 +32,15 b' def win32_clipboard_get():' | |||
|
32 | 32 | win32clipboard.CloseClipboard() |
|
33 | 33 | return text |
|
34 | 34 | |
|
35 | def osx_clipboard_get(): | |
|
35 | def osx_clipboard_get() -> str: | |
|
36 | 36 | """ Get the clipboard's text on OS X. |
|
37 | 37 | """ |
|
38 | 38 | p = subprocess.Popen(['pbpaste', '-Prefer', 'ascii'], |
|
39 | 39 | stdout=subprocess.PIPE) |
|
40 |
|
|
|
40 | bytes_, stderr = p.communicate() | |
|
41 | 41 | # Text comes in with old Mac \r line endings. Change them to \n. |
|
42 |
|
|
|
43 | text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING) | |
|
42 | bytes_ = bytes_.replace(b'\r', b'\n') | |
|
43 | text = py3compat.decode(bytes_) | |
|
44 | 44 | return text |
|
45 | 45 | |
|
46 | 46 | def tkinter_clipboard_get(): |
General Comments 0
You need to be logged in to leave comments.
Login now