From ede0f710f814c62f9e6625c7b166fb7b1fcf5942 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 5 Jun 2017 09:02:51 +0100 Subject: [PATCH] [Core] Replace usage of deprecated new.classobj * type is new module to use --- deluge/__rpcapi.py | 4 +--- tox.ini | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/deluge/__rpcapi.py b/deluge/__rpcapi.py index a2290abb0..8e5de1285 100644 --- a/deluge/__rpcapi.py +++ b/deluge/__rpcapi.py @@ -9,8 +9,6 @@ from __future__ import unicode_literals -from new import classobj - from deluge.core.core import Core from deluge.core.daemon import Daemon @@ -27,7 +25,7 @@ def scan_for_methods(obj): if not hasattr(getattr(obj, d), '_rpcserver_export'): continue 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) diff --git a/tox.ini b/tox.ini index 2cb527f87..3580568a0 100644 --- a/tox.ini +++ b/tox.ini @@ -92,7 +92,7 @@ commands = {[testenv:pydef]commands} ########################### [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 deps = {[testenv]deps}