diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index 7a47a76036..0c6ded74de 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -1,4 +1,4 @@ -from __future__ import print_function +from __future__ import absolute_import, division, print_function, unicode_literals __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' @@ -166,11 +166,11 @@ class OptionParser(optparse.OptionParser): def options_iter(self): for opt in self.option_list: - if str(opt).strip(): + if native_string_type(opt).strip(): yield opt for gr in self.option_groups: for opt in gr.option_list: - if str(opt).strip(): + if native_string_type(opt).strip(): yield opt def option_by_dest(self, dest): diff --git a/src/calibre/utils/mem.py b/src/calibre/utils/mem.py index 815f2d2e0b..f48e8c0510 100644 --- a/src/calibre/utils/mem.py +++ b/src/calibre/utils/mem.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +from __future__ import absolute_import, division, print_function, unicode_literals -from __future__ import print_function __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' @@ -49,4 +49,3 @@ def diff_hists(h1, h2): if h1[k] != h2[k]: print("%s: %d -> %d (%s%d)" % ( k, h1[k], h2[k], h2[k] > h1[k] and "+" or "", h2[k] - h1[k])) - diff --git a/src/calibre/utils/resources.py b/src/calibre/utils/resources.py index 2b380efc42..ea2e704d3c 100644 --- a/src/calibre/utils/resources.py +++ b/src/calibre/utils/resources.py @@ -1,7 +1,6 @@ #!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai -from __future__ import with_statement -from __future__ import print_function +from __future__ import absolute_import, division, print_function, unicode_literals __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' @@ -85,7 +84,7 @@ def get_image_path(path, data=False, allow_user_override=True): def js_name_to_path(name, ext='.coffee'): - path = (u'/'.join(name.split('.'))) + ext + path = ('/'.join(name.split('.'))) + ext d = os.path.dirname base = d(d(os.path.abspath(__file__))) return os.path.join(base, path)