From 76e75d9f89fd2330d9c4571734d9379387b1c42f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 May 2022 10:48:16 +0530 Subject: [PATCH] Ensure self.tdir exists in __del__ --- kitty/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/launch.py b/kitty/launch.py index ec2140f62..642db6fcd 100644 --- a/kitty/launch.py +++ b/kitty/launch.py @@ -571,6 +571,7 @@ def parse_message(msg: str, simple: Container[str]) -> Iterator[Tuple[str, str]] class EditCmd: def __init__(self, msg: str) -> None: + self.tdir = '' self.args: List[str] = [] self.cwd = self.file_name = self.file_localpath = '' self.file_data = b'' @@ -605,7 +606,6 @@ class EditCmd: self.file_name = os.path.basename(self.file_spec) self.file_localpath = os.path.normpath(os.path.join(self.cwd, self.file_spec)) self.is_local_file = False - self.tdir = '' with suppress(FileNotFoundError): st = os.stat(self.file_localpath) self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode