From 0a297f465637add8af277010eda52df093cd614d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Feb 2022 00:27:09 +0530 Subject: [PATCH] proper ordering during shutdown --- kitty_tests/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 8088f8bae..f2cc56f10 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -188,8 +188,9 @@ class PTY: def __del__(self): if not self.is_child: self.queue.put(None) - os.close(self.master_fd) + fd = self.master_fd del self.master_fd + os.close(fd) def write_loop(self): while True: