mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: make completion work
Stop using python2 hack to duplicate python3 print behavior.
This commit is contained in:
parent
61a8db8988
commit
c29219e193
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement, print_function
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
@ -14,10 +14,13 @@ completion.
|
|||||||
|
|
||||||
import sys, os, shlex, glob, re
|
import sys, os, shlex, glob, re
|
||||||
|
|
||||||
from polyglot.builtins import unicode_type
|
from polyglot.builtins import is_py3, unicode_type
|
||||||
|
|
||||||
|
|
||||||
def prints(*args, **kwargs):
|
if is_py3:
|
||||||
|
prints = print
|
||||||
|
else:
|
||||||
|
def prints(*args, **kwargs):
|
||||||
'''
|
'''
|
||||||
Print unicode arguments safely by encoding them to preferred_encoding
|
Print unicode arguments safely by encoding them to preferred_encoding
|
||||||
Has the same signature as the print function from Python 3, except for the
|
Has the same signature as the print function from Python 3, except for the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user