We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0767cc5 commit 9f12c8cCopy full SHA for 9f12c8c
git/types.py
@@ -1,6 +1,20 @@
1
-import os # @UnusedImport ## not really unused, is in type string
+# -*- 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
7
from typing import Union, Any
8
9
10
TBD = Any
-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]]
0 commit comments