summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2022-05-01 21:09:35 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2022-05-01 21:09:41 +0100
commitcd63efd93557d04c0e3570fa89b338696811c8e0 (patch)
treecd3ac7e5f79736aaf920aedd087876e61c535bd8
parent7f0a38057649e03f5d67146e561ad04dc146a8f6 (diff)
downloaddeluge-cd63efd93557d04c0e3570fa89b338696811c8e0.tar.gz
deluge-cd63efd93557d04c0e3570fa89b338696811c8e0.tar.bz2
deluge-cd63efd93557d04c0e3570fa89b338696811c8e0.zip
[Console] Fix curses.init_pair raise ValueError on Py3.10
Fix ValueError crash for console users with Python 3.10 Trac: https://dev.deluge-torrent.org/ticket/3518 See-also: https://docs.python.org/3/whatsnew/3.10.html#curses
-rw-r--r--deluge/ui/console/utils/colors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/deluge/ui/console/utils/colors.py b/deluge/ui/console/utils/colors.py
index 67996e19c..cc414fea5 100644
--- a/deluge/ui/console/utils/colors.py
+++ b/deluge/ui/console/utils/colors.py
@@ -88,8 +88,8 @@ def init_colors():
curses.init_pair(counter, fg, bg)
color_pairs[(fg_name, bg_name)] = counter
counter += 1
- except curses.error as ex:
- log.warning('Error: %s', ex)
+ except (curses.error, ValueError) as ex:
+ log.debug(f'Color pair {fg_name} {bg_name} not available: {ex}')
return counter
# Create the color_pairs dict