Instead of asserting non-unicodeness, let's just encode it.

This commit is contained in:
Jeremy Fincher 2004-02-13 04:43:39 +00:00
parent d3dcc62d1b
commit 681c091309

View File

@ -101,7 +101,8 @@ def canonicalName(command):
Currently, this makes everything lowercase and removes all dashes and Currently, this makes everything lowercase and removes all dashes and
underscores. underscores.
""" """
assert not isinstance(command, unicode) if isinstance(command, unicode):
command = command.encode('utf-8')
special = '\t -_' special = '\t -_'
reAppend = '' reAppend = ''
while command and command[-1] in special: while command and command[-1] in special: