From 8c648d917a0510425fad96bcd387fd5c01775df6 Mon Sep 17 00:00:00 2001 From: toonn Date: Sat, 24 Feb 2018 19:04:50 +0100 Subject: Catch the right errors in addstr Python changed an error from `TypeError` to `ValueError` in version 3.5 now we catch both for backwards compatibility. Relevant issue: https://bugs.python.org/issue22215 Fixes #990 Fixes #1045 Fixes #1079 Fixes #1082 Fixes #1086 --- ranger/gui/curses_shortcuts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index ac067d01..68658026 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -35,7 +35,8 @@ class CursesShortcuts(SettingsAware): try: self.win.addstr(*args) - except (curses.error, TypeError): + except (curses.error, TypeError, ValueError): + # a TE changed to VE from 3.5 (github.com/python/cpython/pull/2302) if len(args) > 1: self.win.move(y, x) -- cgit 1.4.1-2-gfad0 From 806fc471e0bfe044c4b8524db35b5828f1f40b89 Mon Sep 17 00:00:00 2001 From: toonn Date: Sat, 24 Feb 2018 19:38:07 +0100 Subject: Clarify the comment and fix the url --- ranger/gui/curses_shortcuts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index 68658026..14f1e0e4 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -36,7 +36,8 @@ class CursesShortcuts(SettingsAware): try: self.win.addstr(*args) except (curses.error, TypeError, ValueError): - # a TE changed to VE from 3.5 (github.com/python/cpython/pull/2302) + # a TypeError changed to ValueError from version 3.5 onwards + # https://bugs.python.org/issue22215 if len(args) > 1: self.win.move(y, x) -- cgit 1.4.1-2-gfad0 ik/mu/stats/html/107trace.subx.html?h=main'>stats
blob: ce07967ed890b3ece2e7fafb6116ccb5505cd649 (plain) (tree)
1
2
3
4
5
6
7
8
9