/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/util/configobj/configobj.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:
1024
1024
            else:
1025
1025
                self.configspec = None
1026
1026
            return
1027
 
        elif hasattr(infile, 'read'):
 
1027
        elif getattr(infile, 'read', None) is not None:
1028
1028
            # This supports file like objects
1029
1029
            infile = infile.read() or []
1030
1030
            # needs splitting into lines - but needs doing *after* decoding
2852
2852
    >>> uc2 = ConfigObj(file_like)
2853
2853
    >>> uc2 == uc
2854
2854
    1
2855
 
    >>> uc2.filename == None
 
2855
    >>> uc2.filename is None
2856
2856
    1
2857
2857
    >>> uc2.newlines == '\\r'
2858
2858
    1