equal
deleted
inserted
replaced
120 * `NoSectionError` |
120 * `NoSectionError` |
121 * `NoOptionError` |
121 * `NoOptionError` |
122 """ |
122 """ |
123 sect_opt = section_option.lower().split('.') |
123 sect_opt = section_option.lower().split('.') |
124 # TODO: cache it |
124 # TODO: cache it |
125 if len(sect_opt) != 2: # do we need a regexp to check the format? |
125 if len(sect_opt) != 2 or not sect_opt[0] or not sect_opt[1]: |
126 raise BadOptionError(_(u"Bad format: '%s' - expected: " |
126 raise BadOptionError(_(u"Bad format: '%s' - expected: " |
127 u"section.option") % |
127 u"section.option") % |
128 get_unicode(section_option)) |
128 get_unicode(section_option)) |
129 if not sect_opt[0] in self._cfg: |
129 if not sect_opt[0] in self._cfg: |
130 raise NoSectionError(sect_opt[0]) |
130 raise NoSectionError(sect_opt[0]) |