Content-Length: 1979 | pFad | http://github.com/postgrespro/testgres/pull/276.patch
thub.com
From b17d4b3cee73bb54e090d4b7c2f9f0151488d072 Mon Sep 17 00:00:00 2001
From: "d.kovalenko"
Date: Fri, 27 Jun 2025 11:33:29 +0300
Subject: [PATCH] [python v3.13] TestTestgresCommon::test_logging uses
logging._lock
Python 3.13 deleted the following internale functions:
- logging._acquireLock()
- logging._releaseLock()
See https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96 (Sep 27, 2023)
logging._lock was not touched.
So, we use "with logging._lock" instead this pair of deleted function.
Patch was tested with python v3.8.0
---
tests/test_testgres_common.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tests/test_testgres_common.py b/tests/test_testgres_common.py
index 72873a0..3f4a471 100644
--- a/tests/test_testgres_common.py
+++ b/tests/test_testgres_common.py
@@ -622,13 +622,12 @@ def LOCAL__test_lines():
assert (master._logger.is_alive())
finally:
# It is a hack code to logging cleanup
- logging._acquireLock()
- assert logging.Logger.manager is not None
- assert C_NODE_NAME in logging.Logger.manager.loggerDict.keys()
- logging.Logger.manager.loggerDict.pop(C_NODE_NAME, None)
- assert not (C_NODE_NAME in logging.Logger.manager.loggerDict.keys())
- assert not (handler in logging._handlers.values())
- logging._releaseLock()
+ with logging._lock:
+ assert logging.Logger.manager is not None
+ assert C_NODE_NAME in logging.Logger.manager.loggerDict.keys()
+ logging.Logger.manager.loggerDict.pop(C_NODE_NAME, None)
+ assert not (C_NODE_NAME in logging.Logger.manager.loggerDict.keys())
+ assert not (handler in logging._handlers.values())
# GO HOME!
return
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/postgrespro/testgres/pull/276.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy