From b4d92d5cd15d5615ff881f74e99875ba76e04bc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Sat, 30 Jul 2022 12:56:09 +0200
Subject: [PATCH] fixed bug in CPManager, v2.21.1

---
 CHANGELOG.md                           | 2 +-
 satella/__init__.py                    | 2 +-
 satella/coding/resources/cp_manager.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 972a8fe1..e8490402 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,4 +2,4 @@
 
 * removed the decorator syntax for transaction, it''s confusing and contrary to Zen of Python
 * fixed some random bug
-* fixed docs for CPManager
+* fixed docs for CPManager, also fixed a bug for it
diff --git a/satella/__init__.py b/satella/__init__.py
index 7cc264cd..cb17521c 100644
--- a/satella/__init__.py
+++ b/satella/__init__.py
@@ -1 +1 @@
-__version__ = '2.21.1a1'
+__version__ = '2.21.1'
diff --git a/satella/coding/resources/cp_manager.py b/satella/coding/resources/cp_manager.py
index 6dd0daca..6d0d714a 100644
--- a/satella/coding/resources/cp_manager.py
+++ b/satella/coding/resources/cp_manager.py
@@ -97,7 +97,7 @@ class CPManager(Monitor, Closeable, tp.Generic[T], metaclass=abc.ABCMeta):
         if self.id_to_times[obj_id] == self.max_cycle_no:
             with Monitor.acquire(self), silence_excs(KeyError):
                 self.spawned_connections -= 1
-                del self.id_to_times[connection]
+                del self.id_to_times[obj_id]
 
             self.teardown_connection(connection)
         else:
-- 
GitLab