From 82b131cf2afebbed3723df5b5dfd5cd820716f97 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Wed, 30 Jun 2021 18:41:06 +0100 Subject: Type Traversable.traverse() better, start types of submodule --- git/config.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index cc6fcfa4..7982baa3 100644 --- a/git/config.py +++ b/git/config.py @@ -29,8 +29,6 @@ import os.path as osp import configparser as cp -from pathlib import Path - # typing------------------------------------------------------- from typing import Any, Callable, IO, List, Dict, Sequence, TYPE_CHECKING, Tuple, Union, cast, overload @@ -330,7 +328,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje "Write-ConfigParsers can operate on a single file only, multiple files have been passed") # END single file check - if isinstance(self._file_or_files, (str, Path)): # cannot narrow by os._pathlike until 3.5 dropped + if isinstance(self._file_or_files, (str, os.PathLike)): file_or_files = self._file_or_files else: file_or_files = cast(IO, self._file_or_files).name -- cgit v1.2.1