-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
This project's tests use the imp module which has been deprecated since Python 3.4 and removed in 3.12:
- Raised
PendingDeprecationWarningsince 3.4 (2014) - Raised
DeprecationWarningsince 3.5 (2015) - Updated
DeprecationWarningto say removal in 3.12 since 3.10 (2021) - Removal planned for 3.12 (2023)
Python 3.12 is set for release on 2023-10-02 and this library is one of the top 5,000 most-downloaded from PyPI.
Please could you upgrade to use importlib? The imp docs have suggestions on what to use to replace each function and constant.
crochet/crochet/tests/test_api.py
Lines 540 to 564 in deea55f
| imp.acquire_lock() | |
| lock_held.set() | |
| test_complete.wait() | |
| imp.release_lock() | |
| t = threading.Thread(target=other_thread) | |
| t.start() | |
| lock_held.wait() | |
| # While the imp lock is held by the other thread, we can't | |
| # allow exceptions/assertions to happen because trial will | |
| # try to do an import causing a deadlock instead of a | |
| # failure. We collect all assertion pairs (result, expected), | |
| # wait for the import lock to be released, and then check our | |
| # assertions at the end of the test. | |
| assertions = [] | |
| # we want to run .wait while the other thread has the lock acquired | |
| assertions.append((imp.lock_held(), True)) | |
| try: | |
| assertions.append((er.wait(0.1), 123)) | |
| finally: | |
| test_complete.set() | |
| assertions.append((imp.lock_held(), True)) |
Metadata
Metadata
Assignees
Labels
No labels