Browse Source

stdpy: Add missing threading.ThreadError

rdb 5 years ago
parent
commit
c141bef19b
2 changed files with 9 additions and 0 deletions
  1. 2 0
      direct/src/stdpy/threading.py
  2. 7 0
      tests/stdpy/test_threading.py

+ 2 - 0
direct/src/stdpy/threading.py

@@ -34,6 +34,7 @@ __all__ = [
     'Semaphore', 'BoundedSemaphore',
     'Semaphore', 'BoundedSemaphore',
     'Event',
     'Event',
     'Timer',
     'Timer',
+    'ThreadError',
     'local',
     'local',
     'current_thread',
     'current_thread',
     'main_thread',
     'main_thread',
@@ -46,6 +47,7 @@ TIMEOUT_MAX = _thread.TIMEOUT_MAX
 
 
 local = _thread._local
 local = _thread._local
 _newname = _thread._newname
 _newname = _thread._newname
+ThreadError = _thread.error
 
 
 class ThreadBase:
 class ThreadBase:
     """ A base class for both Thread and ExternalThread in this
     """ A base class for both Thread and ExternalThread in this

+ 7 - 0
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()