diff --git a/qutebrowser/utils/url.py b/qutebrowser/utils/url.py index b40e7a9a9..2ac3e7b94 100644 --- a/qutebrowser/utils/url.py +++ b/qutebrowser/utils/url.py @@ -92,7 +92,7 @@ def _is_url_naive(url): """Naive check if given url (QUrl) is really an url.""" PROTOCOLS = ['http://', 'https://'] u = urlstring(url) - return (any([u.startswith(proto) for proto in PROTOCOLS]) or '.' in u or + return (any(u.startswith(proto) for proto in PROTOCOLS) or '.' in u or is_about_url(url) or u == 'localhost') diff --git a/qutebrowser/widgets/browser.py b/qutebrowser/widgets/browser.py index f2aa1eac1..9c00f7351 100644 --- a/qutebrowser/widgets/browser.py +++ b/qutebrowser/widgets/browser.py @@ -398,7 +398,7 @@ class TabbedBrowser(TabWidget): # - Switch back to #1 when loading finished # - It seems loadingStarted is before loadingFinished dbgstr = "{} ({})".format( - signal.signal, ','.join([str(e) for e in args])) + signal.signal, ','.join(str(e) for e in args)) sender = self.sender() if not isinstance(sender, BrowserTab): # FIXME why does this happen? @@ -427,7 +427,7 @@ class TabbedBrowser(TabWidget): """ for (sigstr, (signal, args)) in self.widget(idx).signal_cache.items(): - dbgstr = "{} ({})".format(sigstr, ','.join([str(e) for e in args])) + dbgstr = "{} ({})".format(sigstr, ','.join(str(e) for e in args)) logging.debug('signal cache: emitting {}'.format(dbgstr)) signal.emit(*args) diff --git a/run_checks.py b/run_checks.py index be3db4330..ee6c80431 100644 --- a/run_checks.py +++ b/run_checks.py @@ -119,7 +119,7 @@ def check_line(): ret = [] try: for (dirpath, dirnames, filenames) in os.walk(options['target']): - for name in [e for e in filenames if e.endswith('.py')]: + for name in (e for e in filenames if e.endswith('.py')): fn = os.path.join(dirpath, name) ret.append(_check_line(fn)) status['line'] = all(ret) @@ -134,7 +134,7 @@ def _check_line(fn): if b'\r\n' in line: print('Found CRLF in {}'.format(fn)) return False - elif any([line.decode('UTF-8').startswith(c * 7) for c in "<>=|"]): + elif any(line.decode('UTF-8').startswith(c * 7) for c in "<>=|"): print('Found conflict marker in {}'.format(fn)) return False elif any([line.decode('UTF-8').rstrip('\r\n').endswith(c) @@ -182,7 +182,7 @@ print('Exit status values:') for (k, v) in status.items(): print(' {} - {}'.format(k, v)) -if all([val in [True, 0] for val in status]): +if all(val in [True, 0] for val in status): sys.exit(0) else: sys.exit(1)