Fix bug introduced in 19234d
This commit is contained in:
parent
19234d6565
commit
d91a9504aa
|
@ -72,12 +72,11 @@ import logging
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from twisted.internet.reactor import callLater
|
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
|
||||||
json = deluge.common.json
|
json = deluge.common.json
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
callLater = None # Necessary for the config tests
|
||||||
|
|
||||||
def prop(func):
|
def prop(func):
|
||||||
"""Function decorator for defining property attributes
|
"""Function decorator for defining property attributes
|
||||||
|
@ -219,6 +218,11 @@ what is currently in the config and it could not convert the value
|
||||||
log.debug("Setting '%s' to %s of %s", key, value, type(value))
|
log.debug("Setting '%s' to %s of %s", key, value, type(value))
|
||||||
|
|
||||||
self.__config[key] = value
|
self.__config[key] = value
|
||||||
|
|
||||||
|
global callLater
|
||||||
|
if callLater is None:
|
||||||
|
# Must import here and not at the top or it will throw ReactorAlreadyInstalledError
|
||||||
|
from twisted.internet.reactor import callLater
|
||||||
# Run the set_function for this key if any
|
# Run the set_function for this key if any
|
||||||
try:
|
try:
|
||||||
for func in self.__set_functions[key]:
|
for func in self.__set_functions[key]:
|
||||||
|
|
|
@ -152,12 +152,12 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||||
# Recreate exception and errback'it
|
# Recreate exception and errback'it
|
||||||
try:
|
try:
|
||||||
# The exception class is located in deluge.error
|
# The exception class is located in deluge.error
|
||||||
if hasattr(error, request[2]):
|
try:
|
||||||
exception_cls = getattr(error, request[2])
|
exception_cls = getattr(error, request[2])
|
||||||
exception = exception_cls(*request[3], **request[4])
|
exception = exception_cls(*request[3], **request[4])
|
||||||
else:
|
except TypeError, err:
|
||||||
# Shouldn't happen
|
log.warn("Received invalid RPC_ERROR (Old daemon?): %s", request[2])
|
||||||
raise Exception("Received invalid exception: %s", request[2])
|
return
|
||||||
|
|
||||||
# Ideally we would chain the deferreds instead of instance
|
# Ideally we would chain the deferreds instead of instance
|
||||||
# checking just to log them. But, that would mean that any
|
# checking just to log them. But, that would mean that any
|
||||||
|
@ -187,7 +187,6 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||||
# what's happening
|
# what's happening
|
||||||
log.debug(msg)
|
log.debug(msg)
|
||||||
except:
|
except:
|
||||||
# Failed probably because of invalid data (old daemon)
|
|
||||||
import traceback
|
import traceback
|
||||||
log.error("Failed to handle RPC_ERROR (Old daemon?): %s\nLocal error: %s", request[2], traceback.format_exc())
|
log.error("Failed to handle RPC_ERROR (Old daemon?): %s\nLocal error: %s", request[2], traceback.format_exc())
|
||||||
d.errback(exception)
|
d.errback(exception)
|
||||||
|
|
Loading…
Reference in New Issue