mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Added an assert for easier debugging.
This commit is contained in:
parent
2e0b225d0c
commit
e0cfe722c7
@ -287,6 +287,7 @@ def isValidArgument(s):
|
|||||||
notFunky = string.ascii[32:]+'\x02\x03\x0F\x16\x1F'
|
notFunky = string.ascii[32:]+'\x02\x03\x0F\x16\x1F'
|
||||||
def safeArgument(s):
|
def safeArgument(s):
|
||||||
"""If s is unsafe for IRC, returns a safe version."""
|
"""If s is unsafe for IRC, returns a safe version."""
|
||||||
|
assert not isinstance(s, unicode),'Unicode strings are not allowed in IRC.'
|
||||||
if isValidArgument(s) and s.translate(string.ascii, notFunky) == '':
|
if isValidArgument(s) and s.translate(string.ascii, notFunky) == '':
|
||||||
return s
|
return s
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user