diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2021-08-03 17:06:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 17:06:31 +0100 |
commit | 05c77cf06e82f7932fb9775fad74251ad6c8aa4f (patch) | |
tree | 2491f8abc76300493fc80251fa21a967db48c375 /git/compat.py | |
parent | 335e59dc2cece491a5c5d42396ce70d4ed0715b5 (diff) | |
parent | 0b89bfe855f0faadf359efcfad8ae752d98c6032 (diff) | |
download | gitpython-05c77cf06e82f7932fb9775fad74251ad6c8aa4f.tar.gz |
Merge branch 'main' into patch-1
Diffstat (limited to 'git/compat.py')
-rw-r--r-- | git/compat.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/git/compat.py b/git/compat.py index 7a0a15d2..988c04ef 100644 --- a/git/compat.py +++ b/git/compat.py @@ -29,8 +29,6 @@ from typing import ( Union, overload, ) -from git.types import TBD - # --------------------------------------------------------------------------- @@ -97,19 +95,3 @@ def win_encode(s: Optional[AnyStr]) -> Optional[bytes]: elif s is not None: raise TypeError('Expected bytes or text, but got %r' % (s,)) return None - - -# type: ignore ## mypy cannot understand dynamic class creation -def with_metaclass(meta: Type[Any], *bases: Any) -> TBD: - """copied from https://github.com/Byron/bcore/blob/master/src/python/butility/future.py#L15""" - - class metaclass(meta): # type: ignore - __call__ = type.__call__ - __init__ = type.__init__ # type: ignore - - def __new__(cls, name: str, nbases: Optional[Tuple[int, ...]], d: Dict[str, Any]) -> TBD: - if nbases is None: - return type.__new__(cls, name, (), d) - return meta(name, bases, d) - - return metaclass(meta.__name__ + 'Helper', None, {}) # type: ignore |