diff options
-rw-r--r-- | ranger/actions.py | 3 | ||||
-rw-r--r-- | ranger/container/bookmarks.py | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/ranger/actions.py b/ranger/actions.py index d379c6cf..c1ea7485 100644 --- a/ranger/actions.py +++ b/ranger/actions.py @@ -110,14 +110,13 @@ class Actions(EnvironmentAware, SettingsAware): def enter_bookmark(self, key): """Enter the bookmark with the name <key>""" - from ranger.container.bookmarks import NonexistantBookmark try: destination = self.bookmarks[key] pwd = self.env.pwd if destination.path != pwd.path: self.bookmarks.enter(key) self.bookmarks.remember(pwd) - except NonexistantBookmark: + except KeyError: pass def set_bookmark(self, key): diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py index 6c2ebd63..854758bd 100644 --- a/ranger/container/bookmarks.py +++ b/ranger/container/bookmarks.py @@ -3,9 +3,6 @@ import re import os ALLOWED_KEYS = string.ascii_letters + string.digits + "`'" -class NonexistantBookmark(Exception): - pass - class Bookmarks(object): """Bookmarks is a container which associates keys with bookmarks. @@ -74,7 +71,7 @@ class Bookmarks(object): if key in self.dct: return self.dct[key] else: - raise NonexistantBookmark() + raise KeyError("Nonexistant Bookmark!") def __setitem__(self, key, value): """Bookmark <value> to the key <key>. |