/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/fifo_cache.py

  • Committer: Martin
  • Date: 2017-06-05 20:48:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6658.
  • Revision ID: gzlist@googlemail.com-20170605204831-20accykspjcrx0a8
Apply 2to3 dict fixer and clean up resulting mess using view helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""A simple first-in-first-out (FIFO) cache."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from collections import deque
20
22
 
21
23
 
156
158
        if len(args) == 1:
157
159
            arg = args[0]
158
160
            if isinstance(arg, dict):
159
 
                for key, val in arg.iteritems():
160
 
                    self.add(key, val)
 
161
                for key in arg:
 
162
                    self.add(key, arg[key])
161
163
            else:
162
164
                for key, val in args[0]:
163
165
                    self.add(key, val)
165
167
            raise TypeError('update expected at most 1 argument, got %d'
166
168
                            % len(args))
167
169
        if kwargs:
168
 
            for key, val in kwargs.iteritems():
169
 
                self.add(key, val)
 
170
            for key in kwargs:
 
171
                self.add(key, kwargs[key])
170
172
 
171
173
 
172
174
class FIFOSizeCache(FIFOCache):