/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: Jelmer Vernooij
  • Date: 2017-06-05 23:35:09 UTC
  • mfrom: (6658 work)
  • mto: (6653.3.3 bzrwt)
  • mto: This revision was merged to the branch mainline in revision 6667.
  • Revision ID: jelmer@jelmer.uk-20170605233509-30wo916k6meuggqf
MergeĀ lp:brz

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):