Skip to content

Commit 81498fe

Browse files
committed
Fix PathType for python < 3.6
1 parent 6ac2278 commit 81498fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def id(self, o: object) -> int:
145145
if sys.version_info >= (3, 6):
146146
PathType = Union[AnyStr, 'os.PathLike[AnyStr]']
147147
else:
148-
PathType = AnyStr
148+
# Workaround; PathType = AnyStr would fail below when we use PathType[AnyStr]
149+
PathType = Union[AnyStr]
149150

150151

151152
def _replace(src: PathType[AnyStr], dest: PathType[AnyStr], timeout: float = 1) -> None:

0 commit comments

Comments
 (0)