Fix _StrType in difflib in Python 2. (#2514)

difflib functions accept unicode as well.
This commit is contained in:
Rebecca Chen
2018-10-12 05:39:24 -07:00
committed by Sebastian Rittau
parent a6b4f687e0
commit ea0a0fd17e

View File

@@ -12,7 +12,7 @@ if sys.version_info >= (3,):
_StrType = Text
else:
# Aliases can't point to type vars, so we need to redeclare AnyStr
_StrType = TypeVar('_StrType', str, bytes)
_StrType = TypeVar('_StrType', Text, bytes)
_JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]]