mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 21:25:43 -05:00
wrapper/wrapper: handle unset self.wrapped_config_path
This commit is contained in:
parent
8b0ca115a7
commit
9bd2bd46a9
1 changed files with 4 additions and 2 deletions
|
@ -35,7 +35,7 @@ class Wrapper(WrapperProtocol):
|
||||||
uuid: str
|
uuid: str
|
||||||
identifier: str
|
identifier: str
|
||||||
type: str
|
type: str
|
||||||
wrapped_config_path: str
|
wrapped_config_path: Optional[str]
|
||||||
argv_override: Optional[list[str]]
|
argv_override: Optional[list[str]]
|
||||||
should_exit: bool
|
should_exit: bool
|
||||||
atexit_registered: bool
|
atexit_registered: bool
|
||||||
|
@ -46,6 +46,7 @@ class Wrapper(WrapperProtocol):
|
||||||
self.argv_override = None
|
self.argv_override = None
|
||||||
self.should_exit = True
|
self.should_exit = True
|
||||||
self.atexit_registered = False
|
self.atexit_registered = False
|
||||||
|
self.wrapped_config_path = None
|
||||||
|
|
||||||
def filter_args_wrapper(self, args):
|
def filter_args_wrapper(self, args):
|
||||||
"""filter out -c/--config since it doesn't apply in wrapper"""
|
"""filter out -c/--config since it doesn't apply in wrapper"""
|
||||||
|
@ -89,7 +90,8 @@ class Wrapper(WrapperProtocol):
|
||||||
return wrapped_config
|
return wrapped_config
|
||||||
|
|
||||||
def at_exit(self):
|
def at_exit(self):
|
||||||
os.remove(self.wrapped_config_path)
|
if self.wrapped_config_path:
|
||||||
|
os.remove(self.wrapped_config_path)
|
||||||
self.stop()
|
self.stop()
|
||||||
self.atexit_registered = False
|
self.atexit_registered = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue