mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-24 11:22:34 +00:00
[GTKUI] Fix ImportError with ReactorAlreadyInstalledError
Older systems such as Ubuntu Lucid encountered this import error as Twisted versions < 10 don't have the exception type ReactorAlreadyInstalledError.
This commit is contained in:
parent
75dca80ac4
commit
05b4cb5546
1 changed files with 7 additions and 2 deletions
|
@ -39,11 +39,16 @@ gobject.set_prgname("deluge")
|
||||||
|
|
||||||
# Install the twisted reactor
|
# Install the twisted reactor
|
||||||
from twisted.internet import gtk2reactor
|
from twisted.internet import gtk2reactor
|
||||||
from twisted.internet.error import ReactorAlreadyInstalledError
|
|
||||||
|
try:
|
||||||
|
from twisted.internet.error import ReactorAlreadyInstalledError
|
||||||
|
except ImportError:
|
||||||
|
# ReactorAlreadyInstalledError not available in Twisted version < 10
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
reactor = gtk2reactor.install()
|
reactor = gtk2reactor.install()
|
||||||
except ReactorAlreadyInstalledError, e:
|
except ReactorAlreadyInstalledError:
|
||||||
# Running unit tests so trial already installed a rector
|
# Running unit tests so trial already installed a rector
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue