Ignore lack of discard_backup on GalleryApp

This commit is contained in:
Isaiah Odhner 2023-09-06 02:06:03 -04:00
parent 59feafc309
commit d90f83de21

View File

@ -14,10 +14,11 @@ if TYPE_CHECKING:
def restart_program() -> None:
"""Restarts the current program, after resetting terminal state, and cleaning up file objects and descriptors."""
try:
_app.discard_backup()
except Exception as e:
print("Error discarding backup:", e)
if hasattr(_app, "discard_backup"):
try:
_app.discard_backup() # type: ignore
except Exception as e:
print("Error discarding backup:", e)
try:
_app.exit()