Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pthread_once() to correctly initialize the library. The problem was found using the PySCard test suite in parallel. $ pytest --parallel-threads=2 --iterations=1 test/test_PCSC.py ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 Using --randomly-seed=3545276201 rootdir: /home/rousseau/Documents/sc/pyscard configfile: pyproject.toml plugins: run-parallel-0.3.0, randomly-3.16.0 collected 1 item test/test_PCSC.py F [100%] =================================== FAILURES =================================== ________________________________ test_low_level ________________________________ def test_low_level(): hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) > assert hresult in (SCARD_S_SUCCESS, SCARD_E_NO_SERVICE) E assert 2148532225 in (0, 2148532253) test/test_PCSC.py:6: AssertionError =============================== warnings summary =============================== <frozen importlib._bootstrap>:488 <frozen importlib._bootstrap>:488: DeprecationWarning: builtin type SwigPyPacked has no __module__ attribute <frozen importlib._bootstrap>:488 <frozen importlib._bootstrap>:488: DeprecationWarning: builtin type SwigPyObject has no __module__ attribute -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED test/test_PCSC.py::test_low_level - assert 2148532225 in (0, 2148532253) ======================== 1 failed, 2 warnings in 0.04s ========================= <sys>:0: DeprecationWarning: builtin type swigvarlink has no __module__ attribute
- Loading branch information