Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion between NotImplemented and NotImplementedError #2025

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Moulinette.prompt may raise NotImplementedError exception, but not No…
…tImplemented, which is not an exception
  • Loading branch information
kay0u committed Jan 12, 2025
commit ce9ccb336c1d52d8adc65cf2dc248634e7e17b11
4 changes: 2 additions & 2 deletions src/backup.py
Original file line number Diff line number Diff line change
@@ -1825,7 +1825,7 @@ def _organize_files(self):
size=str(size),
)
)
except NotImplemented:
except NotImplementedError:
raise YunohostError("backup_unable_to_organize_files")
else:
if i != "y" and i != "Y":
@@ -2323,7 +2323,7 @@ def backup_restore(name, system=[], apps=[], force=False):
i = Moulinette.prompt(
m18n.n("restore_confirm_yunohost_installed", answers="y/N")
)
except NotImplemented:
except NotImplementedError:
pass
else:
if i == "y" or i == "Y":
4 changes: 2 additions & 2 deletions src/tools.py
Original file line number Diff line number Diff line change
@@ -534,7 +534,7 @@ def tools_shutdown(operation_logger, force=False):
try:
# Ask confirmation for server shutdown
i = Moulinette.prompt(m18n.n("server_shutdown_confirm", answers="y/N"))
except NotImplemented:
except NotImplementedError:
pass
else:
if i.lower() == "y" or i.lower() == "yes":
@@ -553,7 +553,7 @@ def tools_reboot(operation_logger, force=False):
try:
# Ask confirmation for restoring
i = Moulinette.prompt(m18n.n("server_reboot_confirm", answers="y/N"))
except NotImplemented:
except NotImplementedError:
pass
else:
if i.lower() == "y" or i.lower() == "yes":
Loading