Issue #0002175: Change type() expressions to isinstance() expressions.

Patch from Gerald Britton <gerald.britton@gmail.com>


svn: r10762
This commit is contained in:
Zsolt Foldvari
2008-05-25 19:55:47 +00:00
parent 62b6250d2f
commit 998908175f
53 changed files with 105 additions and 113 deletions

View File

@@ -124,7 +124,7 @@ data_recover_msg = _('The data can only be recovered by Undo operation '
'or by quitting with abandoning changes.')
def fix_encoding(value):
if type(value) != unicode:
if not isinstance(value, unicode):
try:
return unicode(value)
except:
@@ -150,7 +150,7 @@ def xml_lang():
#-------------------------------------------------------------------------
def force_unicode(n):
if type(n) != unicode:
if not isinstance(n, unicode):
return (unicode(n).lower(), unicode(n))
else:
return (n.lower(), n)