From babbd0771cb49260c7874eb12d3bcfddfd1129e2 Mon Sep 17 00:00:00 2001 From: Ismail S Date: Fri, 8 Jul 2016 15:33:13 +0100 Subject: [PATCH] Refactor code --- qutebrowser/browser/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 8ac78da26..326a06e55 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1120,15 +1120,15 @@ class CommandDispatcher: """Save the current page as a bookmark, or a specific url.""" if url and not title: raise cmdexc.CommandError('Title must be provided if url has ' - 'been provided') + 'been provided') bookmark_manager = objreg.get('bookmark-manager') - if isinstance(url, str): + if url is None: + url = self._current_url() + else: try: url = urlutils.fuzzy_url(url) except urlutils.InvalidUrlError as e: raise cmdexc.CommandError(e) - elif not url: - url = self._current_url() if not title: title = self._current_title() try: