Switch from map() to list comprehensions.
This commit is contained in:
parent
251e657bd1
commit
6f9b02741a
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# pylint: disable=line-too-long
|
||||
# pylint: disable=line-too-long,bad-builtin
|
||||
|
||||
"""A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit."""
|
||||
|
||||
@ -29,7 +29,7 @@ __license__ = "GPL"
|
||||
__maintainer__ = __author__
|
||||
__email__ = "mail@qutebrowser.org"
|
||||
__version_info__ = (0, 4, 1)
|
||||
__version__ = '.'.join(map(str, __version_info__))
|
||||
__version__ = '.'.join(str(e) for e in __version_info__)
|
||||
__description__ = "A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit."
|
||||
|
||||
basedir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
@ -45,6 +45,7 @@ def check_python_version():
|
||||
if sys.hexversion < 0x03040000:
|
||||
# We don't use .format() and print_function here just in case someone
|
||||
# still has < 2.6 installed.
|
||||
# pylint: disable=bad-builtin
|
||||
version_str = '.'.join(map(str, sys.version_info[:3]))
|
||||
text = ("At least Python 3.4 is required to run qutebrowser, but " +
|
||||
version_str + " is installed!\n")
|
||||
|
@ -262,7 +262,7 @@ def _get_action_metavar(action, nargs=1):
|
||||
elems = action.metavar
|
||||
return ' '.join("'{}'".format(e) for e in elems)
|
||||
elif action.choices is not None:
|
||||
choices = ','.join(map(str, action.choices))
|
||||
choices = ','.join(str(e) for e in action.choices)
|
||||
return "'{{{}}}'".format(choices)
|
||||
else:
|
||||
return "'{}'".format(action.dest.upper())
|
||||
|
@ -101,7 +101,7 @@ def write_git_file():
|
||||
|
||||
setupdata = {
|
||||
'name': 'qutebrowser',
|
||||
'version': '.'.join(map(str, _get_constant('version_info'))),
|
||||
'version': '.'.join(str(e) for e in _get_constant('version_info')),
|
||||
'description': _get_constant('description'),
|
||||
'long_description': read_file('README.asciidoc'),
|
||||
'url': 'http://www.qutebrowser.org/',
|
||||
|
@ -115,7 +115,7 @@ def test_mhtml(test_name, download_dir, quteproc, httpbin):
|
||||
|
||||
actual_requests = httpbin.get_requests()
|
||||
# Requests are not hashable, we need to convert to ExpectedRequests
|
||||
actual_requests = map(httpbin.ExpectedRequest.from_request,
|
||||
actual_requests)
|
||||
actual_requests = [httpbin.ExpectedRequest.from_request(req)
|
||||
for req in actual_requests]
|
||||
assert (collections.Counter(actual_requests) ==
|
||||
collections.Counter(expected_requests))
|
||||
|
Loading…
Reference in New Issue
Block a user