wrapper/wrapper: handle unset self.wrapped_config_path

This commit is contained in:
InsanePrawn 2023-06-25 03:43:10 +02:00
parent 8b0ca115a7
commit 9bd2bd46a9

View file

@ -35,7 +35,7 @@ class Wrapper(WrapperProtocol):
uuid: str
identifier: str
type: str
wrapped_config_path: str
wrapped_config_path: Optional[str]
argv_override: Optional[list[str]]
should_exit: bool
atexit_registered: bool
@ -46,6 +46,7 @@ class Wrapper(WrapperProtocol):
self.argv_override = None
self.should_exit = True
self.atexit_registered = False
self.wrapped_config_path = None
def filter_args_wrapper(self, args):
"""filter out -c/--config since it doesn't apply in wrapper"""
@ -89,6 +90,7 @@ class Wrapper(WrapperProtocol):
return wrapped_config
def at_exit(self):
if self.wrapped_config_path:
os.remove(self.wrapped_config_path)
self.stop()
self.atexit_registered = False