Skip to content

Commit 2ddf3cc

Browse files
committed
Refine code
1 parent a4f686b commit 2ddf3cc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cli/context.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ def get_res_options(self, name, sect='finder'):
190190
extra_sect = ':'.join([name, sect])
191191
if self.cfg.has_section(extra_sect):
192192
options.update(self.cfg.items(extra_sect))
193-
cfg = self._named_config(name + '.ruler')
194-
if cfg.has_section(sect):
195-
options.update(cfg.items(sect))
193+
if name:
194+
cfg = self._named_config(name + '.ruler')
195+
if cfg.has_section(sect):
196+
options.update(cfg.items(sect))
196197
return options
197198

198199
def get_path(self, local=True):
@@ -525,7 +526,7 @@ def runtime_messages(self):
525526

526527
@property
527528
def need_package_relations(self):
528-
opts = self.get_res_options('xxx', 'builder')
529+
opts = self.get_res_options('', 'builder')
529530
vals = [opts.get(x)
530531
for x in ('enable_rft', 'assert_call', 'assert_import')]
531532
return any([x in ('1', 'true', 'on', 1, True) for x in vals])

0 commit comments

Comments
 (0)