From c141bef19b561f00ae20437d3480f1e77e90f329 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Dec 2020 22:56:26 +0100 Subject: [PATCH] stdpy: Add missing threading.ThreadError --- direct/src/stdpy/threading.py | 2 ++ tests/stdpy/test_threading.py | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/stdpy/test_threading.py diff --git a/direct/src/stdpy/threading.py b/direct/src/stdpy/threading.py index 555f274ee2..668bc386ea 100644 --- a/direct/src/stdpy/threading.py +++ b/direct/src/stdpy/threading.py @@ -34,6 +34,7 @@ __all__ = [ 'Semaphore', 'BoundedSemaphore', 'Event', 'Timer', + 'ThreadError', 'local', 'current_thread', 'main_thread', @@ -46,6 +47,7 @@ TIMEOUT_MAX = _thread.TIMEOUT_MAX local = _thread._local _newname = _thread._newname +ThreadError = _thread.error class ThreadBase: """ A base class for both Thread and ExternalThread in this diff --git a/tests/stdpy/test_threading.py b/tests/stdpy/test_threading.py new file mode 100644 index 0000000000..557a9e428e --- /dev/null +++ b/tests/stdpy/test_threading.py @@ -0,0 +1,7 @@ +from direct.stdpy import threading +import pytest + + +def test_threading_error(): + with pytest.raises(threading.ThreadError): + threading.stack_size()