Skip to content
This repository has been archived by the owner on Feb 17, 2018. It is now read-only.

Commit

Permalink
simplify algorithm to make it more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma committed May 8, 2010
1 parent 8de6e43 commit b8de21b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions zsi/ZSI/TC.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,9 @@ def text_to_data(self, text, elt, ps):
return text.encode(UNICODE_ENCODING)

def get_formatted_content(self, pyobj):
found = False
for typ in _stringtypes:
if isinstance(pyobj, typ):
found = True
break
if not found:
pyobj = str(pyobj)
if isinstance(pyobj, unicode):
return pyobj.encode(UNICODE_ENCODING)
return pyobj

return str(pyobj)

class URI(String):
'''A URI.
Expand Down

0 comments on commit b8de21b

Please sign in to comment.