/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/transport/sftp.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 19:18:40 UTC
  • mto: This revision was merged to the branch mainline in revision 6928.
  • Revision ID: jelmer@jelmer.uk-20180218191840-2wezg20u9ffbfmed
Fix more bees, use with rather than try/finally for some files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
454
454
 
455
455
    def get_bytes(self, relpath):
456
456
        # reimplement this here so that we can report how many bytes came back
457
 
        f = self.get(relpath)
458
 
        try:
 
457
        with self.get(relpath) as f:
459
458
            bytes = f.read()
460
459
            self._report_activity(len(bytes), 'read')
461
460
            return bytes
462
 
        finally:
463
 
            f.close()
464
461
 
465
462
    def _readv(self, relpath, offsets):
466
463
        """See Transport.readv()"""