Skip to content

Commit 5db8084

Browse files
committed
FIX: fix issue #113 reported by @reza1615
1 parent cc593b3 commit 5db8084

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def show_results(prof, stream=None, precision=1):
618618
mem = u''
619619
inc = u''
620620
tmp = template.format(lineno, mem, inc, all_lines[lineno - 1])
621-
stream.write(unicode(tmp))
621+
stream.write(unicode(tmp, 'UTF-8'))
622622
stream.write(u'\n\n')
623623

624624

test/test_unicode.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
# coding: utf-8
2-
3-
import time
4-
1+
# -*- coding: utf-8 -*-
2+
# run only for Python 2.xx
53
@profile
6-
def test_unicode():
4+
def test_unicode(txt):
75
# test when unicode is present
8-
exec("β = 0")
9-
return
10-
6+
txt = txt.replace (u"ی", u"ي") #Arabic Yah = ي
7+
return txt
118
if __name__ == '__main__':
12-
# run only for Python 3
13-
import sys
14-
if sys.version_info >= (3, 0):
15-
test_unicode()
9+
test_unicode (u"ایست")

0 commit comments

Comments
 (0)