doubleclick: sanity check re multiple contexts

This commit is contained in:
Markus Unterwaditzer 2014-08-26 00:43:44 +02:00
parent c78ac67ba9
commit 96b1c08804

View file

@ -100,7 +100,15 @@ def _ctx_pushing_class(cls):
try:
cls.invoke(self, ctx)
finally:
_ctx_stack.pop()
new_ctx = _ctx_stack.pop()
if new_ctx is not ctx:
raise RuntimeError(
'While doubleclick is supposed to make writing '
'threaded applications easier, it removes thread '
'safety from click. It is therefore not recommended '
'to launch more than one doubleclick application per '
'process.'
)
return ContextPusher