Skip to content

Commit

Permalink
Apply six for metaclass
Browse files Browse the repository at this point in the history
The way to using metaclass has changed in Python3.

Python 2.7 way:

class Foo(object):
  __metaclass__ = FooMeta

Python 3 way:

class Foo(object, metaclass=FooMeta):
  ...

The six.add_metaclass() decorator allows us to use one syntax that
works for both Python 2.7 and Python 3.

Change-Id: Ibd31a9f91bac6ec220d802f16c77ee0306e211b3
Closes-Bug: #1236648
  • Loading branch information
fujioka yuuichi committed Oct 18, 2013
1 parent 516586a commit 362cb18
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions novaclient/base.py
Expand Up @@ -163,13 +163,12 @@ def _update(self, url, body, response_key=None, **kwargs):
return self.resource_class(self, body)


@six.add_metaclass(abc.ABCMeta)
class ManagerWithFind(Manager):
"""
Like a `Manager`, but with additional `find()`/`findall()` methods.
"""

__metaclass__ = abc.ABCMeta

@abc.abstractmethod
def list(self):
pass
Expand Down

0 comments on commit 362cb18

Please sign in to comment.