skrooge: 2.31.0 -> 2.33.0 (#365685)
[NixPkgs.git] / pkgs / by-name / bo / botamusique / catch-invalid-versions.patch
blob39b9aae8514ce869c0b74d6d1a0e9656023c8729
1 diff --git a/mumbleBot.py b/mumbleBot.py
2 index 11bc480..7395f41 100644
3 --- a/mumbleBot.py
4 +++ b/mumbleBot.py
5 @@ -188,11 +188,14 @@ class MumbleBot:
6 th.start()
8 last_startup_version = var.db.get("bot", "version", fallback=None)
9 - if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
10 - var.db.set("bot", "version", self.version)
11 - if var.config.getboolean("bot", "auto_check_update"):
12 - changelog = util.fetch_changelog()
13 - self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
14 + try:
15 + if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
16 + var.db.set("bot", "version", self.version)
17 + if var.config.getboolean("bot", "auto_check_update"):
18 + changelog = util.fetch_changelog()
19 + self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
20 + except version.InvalidVersion:
21 + pass
23 # Set the CTRL+C shortcut
24 def ctrl_caught(self, signal, frame):