mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
clarify hasIllegal() arg
This commit is contained in:
parent
67d8284a33
commit
5c008a328e
1 changed files with 3 additions and 3 deletions
|
@ -357,11 +357,11 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0);
|
||||||
def stripIllegal(self, str):
|
def stripIllegal(self, str):
|
||||||
return re.sub(self._illegalCharReg, "", str)
|
return re.sub(self._illegalCharReg, "", str)
|
||||||
|
|
||||||
def hasIllegal(self, str):
|
def hasIllegal(self, s: str):
|
||||||
if re.search(self._illegalCharReg, str):
|
if re.search(self._illegalCharReg, s):
|
||||||
return True
|
return True
|
||||||
try:
|
try:
|
||||||
str.encode(sys.getfilesystemencoding())
|
s.encode(sys.getfilesystemencoding())
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue