From 5c31d2dbc2eb68d99f1a47c27323a160480823c1 Mon Sep 17 00:00:00 2001 From: Israel Brewster Date: Thu, 8 Jun 2017 15:12:06 -0800 Subject: [PATCH] Import datetime into _prune function --- lib/pool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pool.py b/lib/pool.py index 6deeb807..f4c44524 100644 --- a/lib/pool.py +++ b/lib/pool.py @@ -298,6 +298,7 @@ class CachingConnectionPool(AbstractConnectionPool): def _prune(self): """Remove any expired connections from the connection pool.""" + from datetime import datetime, timedelta junk_expirations = [] for obj_id, exp_time in self._expirations.items(): # _expirations is an ordered dict, so results should be in chronological order