File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1- import os # @UnusedImport ## not really unused, is in type string
1+ # -*- coding: utf-8 -*-
2+ # This module is part of GitPython and is released under
3+ # the BSD License: http://www.opensource.org/licenses/bsd-license.php
4+
5+ import os
6+ import sys
27from typing import Union , Any
38
49
510TBD = Any
6- PathLike = Union [str , 'os.PathLike[str]' ]
11+
12+ if sys .version_info [:2 ] < (3 , 6 ):
13+ # os.PathLike (PEP-519) only got introduced with Python 3.6
14+ PathLike = str
15+ elif sys .version_info [:2 ] < (3 , 9 ):
16+ # Python >= 3.6, < 3.9
17+ PathLike = Union [str , os .PathLike ]
18+ elif sys .version_info [:2 ] >= (3 , 9 ):
19+ # os.PathLike only becomes subscriptable from Python 3.9 onwards
20+ PathLike = Union [str , os .PathLike [str ]]
You can’t perform that action at this time.
0 commit comments