#3050: Minor fix for newly added ExtensionOption
---------------------+------------------------------------------------------
Reporter: athomas | Owner: cmlenz
Type: defect | Status: new
Priority: normal | Milestone:
Component: general | Version: devel
Severity: normal | Keywords:
---------------------+------------------------------------------------------
The current implementation assumes the default is a class, but the uses of
it assume it is a string:
{{{
#!diff
Index: trac/config.py
===================================================================
--- trac/config.py (revision 3190)
+++ trac/config.py (working copy)
@@ -349,11 +349,11 @@
if instance is None:
return self
value = Option.__get__(self, instance, owner)
+ if self.default is not None:
+ value = self.default
for impl in self.xtnpt.extensions(instance):
if impl.__class__.__name__ == value:
return impl
- if self.default is not None:
- return self.default(instance.env)
raise AttributeError('Cannot find an implementation of the "%s" '
'interface named "%s". Please update the
option '
'%s.%s in trac.ini.'
}}}
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/3050>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets