From 71d4920ac5c16f2ef37da88b3f563c25c585fb82 Mon Sep 17 00:00:00 2001 From: Andy Kipp Date: Fri, 14 Feb 2025 22:39:10 +0600 Subject: [PATCH] Update pipelines.py: fix checking `self.proc` (#5794) * Update pipelines.py * Create pipelines_fix_check_self_proc.rst --- news/pipelines_fix_check_self_proc.rst | 23 +++++++++++++++++++++++ xonsh/procs/pipelines.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 news/pipelines_fix_check_self_proc.rst diff --git a/news/pipelines_fix_check_self_proc.rst b/news/pipelines_fix_check_self_proc.rst new file mode 100644 index 000000000..0d04d73d8 --- /dev/null +++ b/news/pipelines_fix_check_self_proc.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* pipelines: fixed ``'NoneType' object has no attribute 'pid'`` exception (#5794). + +**Security:** + +* diff --git a/xonsh/procs/pipelines.py b/xonsh/procs/pipelines.py index fabcd0e57..9bb4d58d2 100644 --- a/xonsh/procs/pipelines.py +++ b/xonsh/procs/pipelines.py @@ -727,7 +727,7 @@ class CommandPipeline: @property def pid(self): """Process identifier.""" - return self.proc.pid + return self.proc.pid if self.proc else None @property def returncode(self):