Change __metaclass__ with optimal six.add_metaclass
Use six.add_metaclass instead of __metaclass__.[1] [1]http://docs.openstack.org/developer/hacking/# Change-Id: I4a6e5dc029bab6196256f4e95678e7d3939c3f62
This commit is contained in:
parent
911c16e8eb
commit
1f93449d92
3
tox.ini
3
tox.ini
@ -32,11 +32,10 @@ show-source = True
|
|||||||
#E302: expected 2 blank linee
|
#E302: expected 2 blank linee
|
||||||
#E303: too many blank lines (2)
|
#E303: too many blank lines (2)
|
||||||
#H233: Python 3.x incompatible use of print operator
|
#H233: Python 3.x incompatible use of print operator
|
||||||
#H236: Python 3.x incompatible __metaclass__, use six.add_metaclass()
|
|
||||||
#H302: import only modules.
|
#H302: import only modules.
|
||||||
#H404: multi line docstring should start without a leading new line
|
#H404: multi line docstring should start without a leading new line
|
||||||
#H405: multi line docstring summary not separated with an empty line
|
#H405: multi line docstring summary not separated with an empty line
|
||||||
#H904: Wrap long lines in parentheses instead of a backslash
|
#H904: Wrap long lines in parentheses instead of a backslash
|
||||||
ignore = E123,E125,H803,E302,E303,H233,H236,H302,H404,H405,H904
|
ignore = E123,E125,H803,E302,E303,H233,H302,H404,H405,H904
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import abc
|
import abc
|
||||||
import re
|
import re
|
||||||
|
import six
|
||||||
|
|
||||||
from log import LOG
|
from log import LOG
|
||||||
from pkg_resources import resource_filename
|
from pkg_resources import resource_filename
|
||||||
@ -25,8 +26,8 @@ SCP_DEST_DIR = '/tmp/'
|
|||||||
#
|
#
|
||||||
# A base class for all tools that can be associated to an instance
|
# A base class for all tools that can be associated to an instance
|
||||||
#
|
#
|
||||||
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class PerfTool(object):
|
class PerfTool(object):
|
||||||
__metaclass__ = abc.ABCMeta
|
|
||||||
|
|
||||||
def __init__(self, name, instance):
|
def __init__(self, name, instance):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user