mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -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):
|
||||
return re.sub(self._illegalCharReg, "", str)
|
||||
|
||||
def hasIllegal(self, str):
|
||||
if re.search(self._illegalCharReg, str):
|
||||
def hasIllegal(self, s: str):
|
||||
if re.search(self._illegalCharReg, s):
|
||||
return True
|
||||
try:
|
||||
str.encode(sys.getfilesystemencoding())
|
||||
s.encode(sys.getfilesystemencoding())
|
||||
except UnicodeEncodeError:
|
||||
return True
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue