Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69f8d49

Browse files
[python v3.13] TestTestgresCommon::test_logging uses logging._lock (#276)
Python 3.13 deleted the following internale functions: - logging._acquireLock() - logging._releaseLock()Seepython/cpython@74723e1 (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
1 parentd6be913 commit69f8d49

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

‎tests/test_testgres_common.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -622,13 +622,12 @@ def LOCAL__test_lines():
622622
assert (master._logger.is_alive())
623623
finally:
624624
# It is a hack code to logging cleanup
625-
logging._acquireLock()
626-
assertlogging.Logger.managerisnotNone
627-
assertC_NODE_NAMEinlogging.Logger.manager.loggerDict.keys()
628-
logging.Logger.manager.loggerDict.pop(C_NODE_NAME,None)
629-
assertnot (C_NODE_NAMEinlogging.Logger.manager.loggerDict.keys())
630-
assertnot (handlerinlogging._handlers.values())
631-
logging._releaseLock()
625+
withlogging._lock:
626+
assertlogging.Logger.managerisnotNone
627+
assertC_NODE_NAMEinlogging.Logger.manager.loggerDict.keys()
628+
logging.Logger.manager.loggerDict.pop(C_NODE_NAME,None)
629+
assertnot (C_NODE_NAMEinlogging.Logger.manager.loggerDict.keys())
630+
assertnot (handlerinlogging._handlers.values())
632631
# GO HOME!
633632
return
634633

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp