From e428f857d29affd601488eb3d8f4bca90966d98e Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 12 Apr 2018 18:14:31 +0800 Subject: [PATCH] Better finalize mock --- pipenv/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index af84e490..832105fa 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -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