about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2018-02-24 19:04:50 +0100
committertoonn <toonn@toonn.io>2018-02-24 19:04:50 +0100
commit8c648d917a0510425fad96bcd387fd5c01775df6 (patch)
treede3438b0b42ae8aad3ff7342b8cdc3b63d16e159
parentc2b9dd31de649f19805f07f58814d3054d3c9c54 (diff)
downloadranger-8c648d917a0510425fad96bcd387fd5c01775df6.tar.gz
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
-rw-r--r--ranger/gui/curses_shortcuts.py3
1 files changed, 2 insertions, 1 deletions
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)