~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/text.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-09 18:02:00 UTC
  • mfrom: (1963.2.7 bzr.dev.no_has_key)
  • Revision ID: pqm@pqm.ubuntu.com-20060909180200-96e41112dff213f3
(robey) remove hasattr and == None in favor of getattr() and is None

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        # gzip.GzipFile.read() requires a tell() function
115
115
        # but some transports return objects that cannot seek
116
116
        # so buffer them in a StringIO instead
117
 
        if hasattr(f, 'tell'):
 
117
        if getattr(f, 'tell', None) is not None:
118
118
            return gzip.GzipFile(mode='rb', fileobj=f)
119
119
        else:
120
120
            from cStringIO import StringIO