From 832c59ffbdef5833c8865f9defdfade285c76b46 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 7 Jan 2014 16:23:31 -0500 Subject: Fix a memory leak in pecan.util.memodict Change-Id: Id50ca4d689fa09b15b0928e6e20d336f93a1e85c Fixes-bug: 1266908 --- pecan/util.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'pecan/util.py') diff --git a/pecan/util.py b/pecan/util.py index cf62f97..aa2e683 100644 --- a/pecan/util.py +++ b/pecan/util.py @@ -1,21 +1,10 @@ import sys -def memodict(f): - """ Memoization decorator for a function taking a single argument """ - class memodict(dict): - def __missing__(self, key): - ret = self[key] = f(key) - return ret - return memodict().__getitem__ - - -@memodict def iscontroller(obj): return getattr(obj, 'exposed', False) -@memodict def _cfg(f): if not hasattr(f, '_pecan'): f._pecan = {} -- cgit v1.2.1