##// END OF EJS Templates
%whos unicode fix by Paul Mueller
vivainio -
Show More
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 2301 2007-05-02 06:47:37Z fperez $"""
4 $Id: Magic.py 2308 2007-05-07 08:25:14Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -1056,7 +1056,12 b' Currently the magic system has the following functions:\\n"""'
1056 else:
1056 else:
1057 print '(%s Mb)' % (vbytes/Mb,)
1057 print '(%s Mb)' % (vbytes/Mb,)
1058 else:
1058 else:
1059 vstr = str(var).replace('\n','\\n')
1059 try:
1060 vstr = str(var)
1061 except UnicodeEncodeError:
1062 vstr = unicode(var).encode(sys.getdefaultencoding(),
1063 'backslashreplace')
1064 vstr = vstr.replace('\n','\\n')
1060 if len(vstr) < 50:
1065 if len(vstr) < 50:
1061 print vstr
1066 print vstr
1062 else:
1067 else:
General Comments 0
You need to be logged in to leave comments. Login now