~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tuned_gzip.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-08-18 01:29:12 UTC
  • mfrom: (5377.3.1 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20100818012912-wwgerzeui5ldf5lh
(mbp) slightly better error handling in ftp transport (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
# Written by Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
395
395
        # (4 seconds to 1 seconds for the sample upgrades I was testing).
396
396
        self.write(''.join(lines))
397
397
 
398
 
    if sys.version_info > (2, 7):
399
 
        # As of Python 2.7 the crc32 must be positive when close is called
400
 
        def close(self):
401
 
            if self.fileobj is None:
402
 
                return
403
 
            if self.mode == gzip.WRITE:
404
 
                self.crc &= 0xFFFFFFFFL
405
 
            gzip.GzipFile.close(self)
406
398