Show More
@@ -1273,7 +1273,9 b' cachefuncs = {}' | |||||
1273 | def cachefor(name): |
|
1273 | def cachefor(name): | |
1274 | """Decorator to register a function as computing the cache for a set""" |
|
1274 | """Decorator to register a function as computing the cache for a set""" | |
1275 | def decorator(func): |
|
1275 | def decorator(func): | |
1276 |
|
|
1276 | if name in cachefuncs: | |
|
1277 | msg = "duplicated registration for volatileset '%s' (existing: %r)" | |||
|
1278 | raise error.ProgrammingError(msg % (name, cachefuncs[name])) | |||
1277 | cachefuncs[name] = func |
|
1279 | cachefuncs[name] = func | |
1278 | return func |
|
1280 | return func | |
1279 | return decorator |
|
1281 | return decorator |
General Comments 0
You need to be logged in to leave comments.
Login now