Better finalize mock

This commit is contained in:
Tzu-ping Chung
2018-04-12 18:14:31 +08:00
parent d8b1d637e0
commit e428f857d2
+6 -2
View File
@@ -22,8 +22,12 @@ except ImportError:
try:
from backports.weakref import finalize
except ImportError:
def finalize(*args, **kwargs):
logging.warn('weakref.finalize unavailable, not cleaning...')
class finalize(object):
def __init__(self, *args, **kwargs):
logging.warn('weakref.finalize unavailable, not cleaning...')
def detach(self):
return False
from time import time