/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 bzrlib/pack.py

  • Committer: Martin Pool
  • Date: 2009-07-01 07:25:44 UTC
  • mto: This revision was merged to the branch mainline in revision 4502.
  • Revision ID: mbp@sourcefrog.net-20090701072544-bura816uths26pd6
Remove stray pdb call

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
175
175
 
176
176
        :param readv_result: the most recent readv result - list or generator
177
177
        """
178
 
        # readv can return a sequence or an iterator, but we require an
179
 
        # iterator to know how much has been consumed.
180
 
        readv_result = iter(readv_result)
 
178
        # we rely on its state as a generator to keep track of how much has
 
179
        # been used.
 
180
        if not getattr(readv_result, 'next'):
 
181
            readv_result = iter(readv_result)
181
182
        self.readv_result = readv_result
182
183
        self._string = None
183
184
 
203
204
        result = self._string.readline()
204
205
        if self._string.tell() == self._string_length and result[-1] != '\n':
205
206
            raise errors.BzrError('short readline in the readvfile hunk: %r'
206
 
                % (result, ))
 
207
                % (readline, ))
207
208
        return result
208
209
 
209
210