Edgewall Software

Ticket #13: get_config_items.patch

File get_config_items.patch, 723 bytes (added by vittorio, 8 years ago)

fixes AttributeError? for python<2.3

  • trac/Environment.py

     
    182182    def get_config_items(self, section): 
    183183        if not self.cfg.has_section(section): 
    184184            return None 
    185         return self.cfg.items(section) 
     185        try: 
     186            return self.cfg.items(section) 
     187        except AttributeError: 
     188            items=[] 
     189            for option in self.cfg.options(section): 
     190                items.append((option,self.cfg.get(section,option))) 
     191            return items     
    186192 
    187193    def save_config(self): 
    188194        self.cfg.write(open(os.path.join(self.path, 'conf', 'trac.ini'), 'w'))