mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
Fix unhandled error with empty clipboard on Win32
This commit is contained in:
parent
68b413af5f
commit
c398ef57a5
1 changed files with 5 additions and 1 deletions
|
@ -626,7 +626,11 @@ class AddTorrentDialog(component.Component):
|
||||||
import win32clipboard as clip
|
import win32clipboard as clip
|
||||||
import win32con
|
import win32con
|
||||||
clip.OpenClipboard()
|
clip.OpenClipboard()
|
||||||
|
try:
|
||||||
text = clip.GetClipboardData(win32con.CF_UNICODETEXT)
|
text = clip.GetClipboardData(win32con.CF_UNICODETEXT)
|
||||||
|
except TypeError:
|
||||||
|
# Catch empty clipboard error
|
||||||
|
text = ''
|
||||||
clip.CloseClipboard()
|
clip.CloseClipboard()
|
||||||
else:
|
else:
|
||||||
clip = gtk.clipboard_get(selection='PRIMARY')
|
clip = gtk.clipboard_get(selection='PRIMARY')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue