/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: Matt Nordhoff
  • Date: 2008-02-27 21:36:16 UTC
  • mto: This revision was merged to the branch mainline in revision 3257.
  • Revision ID: mnordhoff@mattnordhoff.com-20080227213616-3dm9apo8piay0z71
Restore hasattr -> getattr

Show diffs side-by-side

added added

removed removed

Lines of Context:
1312
1312
                self.configspec = None
1313
1313
            return
1314
1314
        
1315
 
        elif hasattr(infile, 'read'):
 
1315
        elif getattr(infile, 'read', None) is not None:
1316
1316
            # This supports file like objects
1317
1317
            infile = infile.read() or []
1318
1318
            # needs splitting into lines - but needs doing *after* decoding
1956
1956
                # FIXME: can we supply any useful information here ?
1957
1957
                raise RepeatSectionError()
1958
1958
            
1959
 
        if hasattr(configspec, 'initial_comment'):
 
1959
        if getattr(configspec, 'initial_comment', None) is not None:
1960
1960
            section._configspec_initial_comment = configspec.initial_comment
1961
1961
            section._configspec_final_comment = configspec.final_comment
1962
1962
            section._configspec_encoding = configspec.encoding
2201
2201
            section = self
2202
2202
        #
2203
2203
        spec_section = section.configspec
2204
 
        if copy and hasattr(section, '_configspec_initial_comment'):
 
2204
        if copy and getattr(section, '_configspec_initial_comment', None) is not None:
2205
2205
            section.initial_comment = section._configspec_initial_comment
2206
2206
            section.final_comment = section._configspec_final_comment
2207
2207
            section.encoding = section._configspec_encoding
2262
2262
                    except KeyError:
2263
2263
                        pass
2264
2264
                    
2265
 
                if hasattr(validator, 'get_default_value'):
 
2265
                if getattr(validator, 'get_default_value', None) is not None:
2266
2266
                    try: 
2267
2267
                        section.default_values[entry] = validator.get_default_value(spec_section[entry])
2268
2268
                    except KeyError: