Ticket #5339 (closed defect: fixed)
GeneratorExit thrown in trac/wiki/macros.py
| Reported by: | njg@… | Owned by: | thatch |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10.5 |
| Component: | wiki system | Version: | 0.10.4 |
| Severity: | normal | Keywords: | python25 |
| Cc: | dluke@… |
Description (last modified by cboos) (diff)
Class UserMacroProvider throws an annoying error in method get_macros (with python 2.5). Simple (2 line) fix, where the GeneratorExit exception is ignored.
snippet from trac/wiki/macros.py
def get_macros(self):
found = []
for path in (self.env_macros, self.site_macros):
if not os.path.exists(path):
continue
for filename in [filename for filename in os.listdir(path)
if filename.lower().endswith('.py')
and not filename.startswith('__')]:
try:
module = self._load_macro(filename[:-3])
name = module.__name__
if name in found:
continue
found.append(name)
yield name
except GeneratorExit:
pass
except Exception, e:
self.log.error('Failed to load wiki macro %s (%s)',
filename, e, exc_info=True)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


