[Core] Replace usage of deprecated new.classobj
* type is new module to use
This commit is contained in:
parent
66718f6d8e
commit
ede0f710f8
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from new import classobj
|
|
||||||
|
|
||||||
from deluge.core.core import Core
|
from deluge.core.core import Core
|
||||||
from deluge.core.daemon import Daemon
|
from deluge.core.daemon import Daemon
|
||||||
|
|
||||||
@ -27,7 +25,7 @@ def scan_for_methods(obj):
|
|||||||
if not hasattr(getattr(obj, d), '_rpcserver_export'):
|
if not hasattr(getattr(obj, d), '_rpcserver_export'):
|
||||||
continue
|
continue
|
||||||
methods[d] = getattr(obj, d)
|
methods[d] = getattr(obj, d)
|
||||||
cobj = classobj(obj.__name__.lower(), (object,), methods)
|
cobj = type(obj.__name__.lower(), (object,), methods)
|
||||||
setattr(RpcApi, obj.__name__.lower(), cobj)
|
setattr(RpcApi, obj.__name__.lower(), cobj)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
tox.ini
2
tox.ini
@ -92,7 +92,7 @@ commands = {[testenv:pydef]commands}
|
|||||||
###########################
|
###########################
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
# Disble site packages to avoid using system flake8 which uses hardcoded python path which imports the wrong libraries.
|
# Disable site packages to avoid using system flake8 which uses hardcoded python path which imports the wrong libraries.
|
||||||
sitepackages = False
|
sitepackages = False
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user