mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
jobs: catching ChildProcessError (#5365)
* Update jobs.py * Create jobs_catch_no_process.rst * Update jobs.py * Update jobs_catch_no_process.rst * Update jobs.py
This commit is contained in:
parent
8ab1b9a0ee
commit
61751c2319
2 changed files with 26 additions and 0 deletions
23
news/jobs_catch_no_process.rst
Normal file
23
news/jobs_catch_no_process.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* Added catching ChildProcessError in jobs. Avoiding hanging aliases in some cases.
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -267,6 +267,9 @@ else:
|
|||
obj = active_task["obj"]
|
||||
backgrounded = False
|
||||
try:
|
||||
if obj.pid is None:
|
||||
# When the process stopped before os.waitpid it has no pid.
|
||||
raise ChildProcessError("The process PID not found.")
|
||||
_, wcode = os.waitpid(obj.pid, os.WUNTRACED)
|
||||
except ChildProcessError as e: # No child processes
|
||||
if return_error:
|
||||
|
|
Loading…
Add table
Reference in a new issue