Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions 18 git/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import os # @UnusedImport ## not really unused, is in type string
# -*- coding: utf-8 -*-
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

import os
import sys
from typing import Union, Any


TBD = Any
PathLike = Union[str, 'os.PathLike[str]']

if sys.version_info[:2] < (3, 6):
# os.PathLike (PEP-519) only got introduced with Python 3.6
PathLike = str
elif sys.version_info[:2] < (3, 9):
# Python >= 3.6, < 3.9
PathLike = Union[str, os.PathLike]
elif sys.version_info[:2] >= (3, 9):
# os.PathLike only becomes subscriptable from Python 3.9 onwards
PathLike = Union[str, os.PathLike[str]]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.