##// END OF EJS Templates
Further Python 3 fixes in core.
Thomas Kluyver -
Show More
@@ -1677,7 +1677,9 b' class InteractiveShell(SingletonConfigurable, Magic):'
1677 1677
1678 1678 # Remove some chars from the delimiters list. If we encounter
1679 1679 # unicode chars, discard them.
1680 delims = readline.get_completer_delims().encode("ascii", "ignore")
1680 delims = readline.get_completer_delims()
1681 if not py3compat.PY3:
1682 delims = delims.encode("ascii", "ignore")
1681 1683 for d in self.readline_remove_delims:
1682 1684 delims = delims.replace(d, "")
1683 1685 delims = delims.replace(ESC_MAGIC, '')
@@ -10,6 +10,8 b''
10 10 import re
11 11 import sys
12 12
13 from IPython.utils import py3compat
14
13 15 coding_declaration = re.compile(r"#\s*coding[:=]\s*([-\w.]+)")
14 16
15 17 class Macro(object):
@@ -37,8 +39,7 b' class Macro(object):'
37 39 self.value = code + '\n'
38 40
39 41 def __str__(self):
40 enc = sys.stdin.encoding or sys.getdefaultencoding()
41 return self.value.encode(enc, "replace")
42 return py3compat.unicode_to_str(self.value)
42 43
43 44 def __unicode__(self):
44 45 return self.value
@@ -676,7 +676,7 b' Currently the magic system has the following functions:\\n"""'
676 676
677 677 %psearch -a _* list objects beginning with a single underscore"""
678 678 try:
679 parameter_s = parameter_s.encode('ascii')
679 parameter_s.encode('ascii')
680 680 except UnicodeEncodeError:
681 681 print 'Python identifiers can only contain ascii characters.'
682 682 return
General Comments 0
You need to be logged in to leave comments. Login now