summaryrefslogtreecommitdiff
path: root/apscheduler
diff options
context:
space:
mode:
authoragronholm <devnull@localhost>2011-04-12 07:05:53 +0300
committeragronholm <devnull@localhost>2011-04-12 07:05:53 +0300
commit3c2ac2de12a1d19fa28d5f10cba03b072a517066 (patch)
treebd8477dc9a57c0c64f11260b1b8caa91c21e8062 /apscheduler
parente7925538748e97d64ddf2182cfb5414e53eecbc2 (diff)
downloadapscheduler-3c2ac2de12a1d19fa28d5f10cba03b072a517066.tar.gz
Raise a RuntimeError when attempting to schedule tasks in the thread pool after it has been shutdown, imitating PEP 3148 thread pool behavior
Diffstat (limited to 'apscheduler')
-rw-r--r--apscheduler/threadpool.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/apscheduler/threadpool.py b/apscheduler/threadpool.py
index 8d6d7ed..8b87260 100644
--- a/apscheduler/threadpool.py
+++ b/apscheduler/threadpool.py
@@ -107,7 +107,7 @@ class ThreadPool(object):
def submit(self, func, *args, **kwargs):
if self._shutdown:
- raise Exception('Thread pool has already been shut down')
+ raise RuntimeError('Cannot schedule new tasks after shutdown')
self._queue.put((func, args, kwargs))
self._adjust_threadcount()