From e700a114fc97ea3147ff5cba67c5cc09642b2fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrer=20=C3=96zen?= Date: Tue, 11 Oct 2005 20:41:05 +0000 Subject: [PATCH] =?UTF-8?q?string=20olmayan=20objeye=20takla=20att=C4=B1rm?= =?UTF-8?q?aya=20gerek=20yok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/repostats.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/repostats.py b/tools/repostats.py index 039d77bd..642e604c 100755 --- a/tools/repostats.py +++ b/tools/repostats.py @@ -151,14 +151,12 @@ valid_filetypes = [ ] def printu(obj): - """smart print command which handles unicode strings and objects which - return unicode __str__'s, a common case in our implementation""" - if isinstance(obj, str): - print obj - elif isinstance(obj, unicode): + if isinstance(obj, unicode): print obj.encode('utf-8') + elif isinstance(obj, str): + print obj.decode('utf-8') else: - print unicode(obj).encode('utf-8') # this is printu! + print str(obj) def valuesort(x, y): if x[1] > y[1]: