Commit 7f3e866e authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[py3] Modernize

parent d496f4739032
......@@ -6,7 +6,7 @@ from cubicweb_seda.dataimport import LCSV_FILES, import_seda_schemes
# uri. Should be done there but still easier here.
try:
from cubicweb_saem_ref.site_cubicweb import init_seda_scheme
init_seda_scheme.func_defaults[0][0] = len(LCSV_FILES) - 1
init_seda_scheme.__defaults__[0][0] = len(LCSV_FILES) - 1
except ImportError:
pass
......
......@@ -20,12 +20,13 @@ writing of generated content back to the file-system.
"""
from doctest import Example
from itertools import chain, izip, repeat
from itertools import chain, repeat
import os
from os.path import basename, join
import unittest
from six import binary_type, text_type
from six.moves import zip
from lxml import etree
from lxml.doctestcompare import LXMLOutputChecker
......@@ -191,8 +192,8 @@ class RelaxNGTestMixin(XmlTestMixin):
adefs = []
optattrs = self.xpath(element, 'rng:optional/rng:attribute')
attrs = self.xpath(element, 'rng:attribute')
for use, adef_element in chain(izip(repeat('optional'), optattrs),
izip(repeat('required'), attrs)):
for use, adef_element in chain(zip(repeat('optional'), optattrs),
zip(repeat('required'), attrs)):
adef = dict(adef_element.attrib)
adef['use'] = use
data_elements = self.xpath(adef_element, 'rng:data')
......
......@@ -19,6 +19,7 @@ from json import dumps
import unittest
from six import text_type
from six.moves import zip
from cubicweb.devtools.testlib import CubicWebTC
from cubicweb.web import INTERNAL_FIELD_VALUE
......@@ -515,9 +516,9 @@ class CloneImportTC(CubicWebTC):
{'p': eid})
self.assertEqual(len(rset), 2)
self.assertCountEqual([oeid for __, oeid in rset.rows], to_clone)
cardinalities, annotations = zip(*[
cardinalities, annotations = list(zip(*[
(clone.user_cardinality, clone.user_annotation)
for clone in rset.entities()])
for clone in rset.entities()]))
self.assertCountEqual(cardinalities, ('1', '0..1'))
self.assertCountEqual(annotations, ('plop', 'plouf'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment