diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-24 22:05:06 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-24 22:05:06 +0100 |
commit | d812818cb20c39e0bb5609186214ea4bcc18c047 (patch) | |
tree | 59caeb4d7a9d0ee97553ce09ad5c19e85d76134d /git/compat.py | |
parent | 2bc2ac02e270404fcb609eeacc4feea6146b9d2e (diff) | |
download | gitpython-d812818cb20c39e0bb5609186214ea4bcc18c047.tar.gz |
Rmv with_metaclass shim, make section constraint generic wrt its configparser type
Diffstat (limited to 'git/compat.py')
-rw-r--r-- | git/compat.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/git/compat.py b/git/compat.py index 7a0a15d2..b3b6ab81 100644 --- a/git/compat.py +++ b/git/compat.py @@ -97,19 +97,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 |