Modify ↓
Opened 19 years ago
Closed 19 years ago
#3050 closed defect (fixed)
Minor fix for newly added ExtensionOption
Reported by: | Alec Thomas | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | normal | Milestone: | 0.10 |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The current implementation assumes the default is a class, but the uses of it assume it is a string:
-
trac/config.py
349 349 if instance is None: 350 350 return self 351 351 value = Option.__get__(self, instance, owner) 352 if self.default is not None: 353 value = self.default 352 354 for impl in self.xtnpt.extensions(instance): 353 355 if impl.__class__.__name__ == value: 354 356 return impl 355 if self.default is not None:356 return self.default(instance.env)357 357 raise AttributeError('Cannot find an implementation of the "%s" ' 358 358 'interface named "%s". Please update the option ' 359 359 '%s.%s in trac.ini.'
Attachments (0)
Note:
See TracTickets
for help on using tickets.
That would make the default always override the actual value… I think it should suffice to remove the two lines your patch removes, as the default should already be handled by
Option.__get__
.