Commit ec7d0cf0 authored by Guido Günther's avatar Guido Günther

Kill six.iteritems

parent c3010e4b
......@@ -15,8 +15,6 @@
# along with this program; if not, please see
# <http://www.gnu.org/licenses/>
import six
from .compressor import Compressor
......@@ -71,7 +69,7 @@ class Archive(object):
base_name = ".".join(split[:-1])
(archive_fmt, compression) = (split[-1], None)
else:
for (c, ext) in six.iteritems(Compressor.Exts):
for (c, ext) in Compressor.Exts.items():
if ext == split[-1]:
base_name = ".".join(split[:-1])
compression = c
......
......@@ -699,7 +699,7 @@ class SpecFile(object):
macro_line = self._content.insert_after(macro_line, comment_text)
macro_line = self._set_special_macro('patch', patchnum, '-p1',
macro_line)
for cmd, args in six.iteritems(cmds):
for cmd, args in cmds.items():
if cmd in ('if', 'ifarch'):
self._content.insert_before(macro_line, '%%%s %s\n' %
(cmd, args))
......@@ -784,7 +784,7 @@ class SpecFile(object):
"""
orig = None
sources = self.sources()
for num, filename in sorted(six.iteritems(sources)):
for num, filename in sorted(sources.items()):
src = {'num': num, 'filename': os.path.basename(filename),
'uri': filename}
src['filename_base'], src['archive_fmt'], src['compression'] = \
......
......@@ -8,8 +8,6 @@ import os
import tarfile
import unittest
import six
import gbp.pkg
......@@ -49,7 +47,7 @@ class TestUnpack(unittest.TestCase):
context.teardown()
def test_upstream_source_type(self):
for (comp, archive) in six.iteritems(self.archives):
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
assert source.is_orig() is True
assert source.is_dir() is False
......@@ -60,13 +58,13 @@ class TestUnpack(unittest.TestCase):
assert type(source.unpacked) == str
def test_upstream_source_unpack(self):
for (comp, archive) in six.iteritems(self.archives):
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
source.unpack(".")
self._check_files(archive[1], comp)
def test_upstream_source_unpack_no_filter(self):
for (comp, archive) in six.iteritems(self.archives):
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
source.unpack(".", [])
self._check_files(archive[1], comp)
......@@ -74,7 +72,7 @@ class TestUnpack(unittest.TestCase):
def test_upstream_source_unpack_filtered(self):
exclude = "README.md"
for (comp, archive) in six.iteritems(self.archives):
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
source.unpack(".", [exclude])
archive[1].remove(exclude)
......
......@@ -22,8 +22,6 @@ import shutil
import tempfile
from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
import six
from gbp.errors import GbpError
from gbp.rpm import (SpecFile, SrcRpmFile, NoSpecError, guess_spec,
guess_spec_repo, spec_from_repo)
......@@ -299,7 +297,7 @@ class TestSpecFile(RpmTestBase):
spec = SpecFileTester(spec_filepath)
# Check all the tags
for name, val in six.iteritems(spec.protected('_tags')):
for name, val in spec.protected('_tags').items():
rval = None
if name in ('version', 'release', 'epoch'):
rval = '0'
......
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