/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: 2008-02-27 19:53:31 UTC
  • mfrom: (3221.8.1 configobj-4.5.1)
  • Revision ID: pqm@pqm.ubuntu.com-20080227195331-0nc0vzgjka1ornoe
Convert hasattr to getatter in ConfigObj (mnordhoff)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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: