Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 171716d4f3df815b2f4c0129de85031c2dc04b69
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Nov 2 17:14:57 2015 +0100
python3 compatibility
metaclass has different usage under PY3
---------------------------------------------------------------
python/copr/client_v2/resources.py | 6 ++++--
python/python-copr.spec | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/python/copr/client_v2/resources.py b/python/copr/client_v2/resources.py
index 183a3c1..0d118b8 100644
--- a/python/copr/client_v2/resources.py
+++ b/python/copr/client_v2/resources.py
@@ -1,5 +1,6 @@
# coding: utf-8
from collections import Iterable
+from six import with_metaclass
from ..util import UnicodeMixin
@@ -41,14 +42,15 @@ class EntityFieldsMetaClass(type):
return type.__new__(cls, class_name, bases, class_attrs)
-class IndividualResource(UnicodeMixin):
+class IndividualResource(with_metaclass(EntityFieldsMetaClass, UnicodeMixin)):
"""
:type handle: client_v2.handlers.AbstractHandle or None
:type response: ResponseWrapper or None
:type links: (dict of (str, Link)) or None
"""
_schema = EmptySchema(strict=True)
- __metaclass__ = EntityFieldsMetaClass
+ # PY2 compatibility
+ #__metaclass__ = EntityFieldsMetaClass
def __init__(self, entity, handle=None, response=None, links=None, embedded=None,
options=None):
diff --git a/python/python-copr.spec b/python/python-copr.spec
index 739ab20..322c4b7 100644
--- a/python/python-copr.spec
+++ b/python/python-copr.spec
@@ -148,7 +148,7 @@ cp -a docs/_build/html %{buildroot}%{_pkgdocdir}/
%if 0%{?with_python3}
pushd %{py3dir}
-#%{__python3} -m pytest copr/test
+%{__python3} -m pytest copr/test
popd
%endif # with_python3