Projet

Général

Profil

0001-python3-deprecate-__metaclass__-attribute-31182.patch

Paul Marillonnet, 06 mars 2019 22:00

Télécharger (2,35 ko)

Voir les différences:

Subject: [PATCH] python3: deprecate __metaclass__ attribute (#31182)

 src/authentic2/attributes_ng/sources/__init__.py | 5 +++--
 src/authentic2/manager/views.py                  | 5 ++---
 src/authentic2/passwords.py                      | 3 +--
 3 files changed, 6 insertions(+), 7 deletions(-)
src/authentic2/attributes_ng/sources/__init__.py
1 1
import abc
2
from six import add_metaclass
2 3

  
4

  
5
@add_metaclass(abc.ABCMeta)
3 6
class BaseAttributeSource(object):
4 7
    '''
5 8
    Base class for attribute sources
6 9
    '''
7
    __metaclass__ = abc.ABCMeta
8

  
9 10
    @abc.abstractmethod
10 11
    def get_instances(self, ctx):
11 12
        pass
src/authentic2/manager/views.py
23 23

  
24 24
from django_rbac.utils import get_ou_model
25 25

  
26
from six import add_metaclass
26 27
from authentic2.data_transfer import export_site, import_site, DataImportError, ImportContext
27 28
from authentic2.forms import modelform_factory, SiteImportForm
28 29
from authentic2.utils import redirect, batch_queryset
......
53 54
        return super(MultipleOUMixin, self).get_context_data(**kwargs)
54 55

  
55 56

  
57
@add_metaclass(MediaMixinBase)
56 58
class MediaMixin(object):
57 59
    '''Expose needed CSS and JS files as a media object'''
58

  
59
    __metaclass__ = MediaMixinBase
60

  
61 60
    class Media:
62 61
        js = (
63 62
            reverse_lazy('a2-manager-javascript-catalog'),
src/authentic2/passwords.py
34 34
    return ''.join(new_password)
35 35

  
36 36

  
37
@six.add_metaclass(abc.ABCMeta)
37 38
class PasswordChecker(object):
38
    __metaclass__ = abc.ABCMeta
39

  
40 39
    class Check(object):
41 40
        def __init__(self, label, result):
42 41
            self.label = label
43
-