mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
unthreadable xontrib command
This commit is contained in:
parent
f85a0c2ec1
commit
6cbbcb75ed
2 changed files with 17 additions and 1 deletions
15
news/unthreadsig.rst
Normal file
15
news/unthreadsig.rst
Normal file
|
@ -0,0 +1,15 @@
|
|||
**Added:** None
|
||||
|
||||
**Changed:**
|
||||
|
||||
* The ``xontrib`` command is now flagged as unthreadable and will be
|
||||
run on the main Python thread. This allows xontribs to set signal
|
||||
handlers and other operations that require the main thread.
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:** None
|
||||
|
||||
**Security:** None
|
|
@ -8,7 +8,7 @@ import functools
|
|||
import importlib
|
||||
import importlib.util
|
||||
|
||||
from xonsh.tools import print_color
|
||||
from xonsh.tools import print_color, unthreadable
|
||||
|
||||
|
||||
@functools.lru_cache(1)
|
||||
|
@ -157,6 +157,7 @@ _MAIN_XONTRIB_ACTIONS = {
|
|||
}
|
||||
|
||||
|
||||
@unthreadable
|
||||
def xontribs_main(args=None, stdin=None):
|
||||
"""Alias that loads xontribs"""
|
||||
if not args or (args[0] not in _MAIN_XONTRIB_ACTIONS and
|
||||
|
|
Loading…
Add table
Reference in a new issue