@@ -275,7 +275,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje
275
275
# list of RawConfigParser methods able to change the instance
276
276
_mutating_methods_ = ("add_section" , "remove_section" , "remove_option" , "set" )
277
277
278
- def __init__ (self , file_or_files : Union [None , PathLike , BytesIO , Sequence [Union [PathLike , BytesIO ]]] = None ,
278
+ def __init__ (self , file_or_files : Union [None , PathLike , ' BytesIO' , Sequence [Union [PathLike , ' BytesIO' ]]] = None ,
279
279
read_only : bool = True , merge_includes : bool = True ,
280
280
config_level : Union [Lit_config_levels , None ] = None ,
281
281
repo : Union ['Repo' , None ] = None ) -> None :
@@ -667,7 +667,7 @@ def write(self) -> None:
667
667
fp = self ._file_or_files
668
668
669
669
# we have a physical file on disk, so get a lock
670
- is_file_lock = isinstance (fp , (str , IOBase )) # can't use Pathlike until 3.5 dropped
670
+ is_file_lock = isinstance (fp , (str , os . PathLike , IOBase )) # can't use Pathlike until 3.5 dropped
671
671
if is_file_lock and self ._lock is not None : # else raise Error?
672
672
self ._lock ._obtain_lock ()
673
673
@@ -676,7 +676,7 @@ def write(self) -> None:
676
676
with open (fp , "wb" ) as fp_open :
677
677
self ._write (fp_open )
678
678
else :
679
- fp = cast (BytesIO , fp )
679
+ fp = cast (' BytesIO' , fp )
680
680
fp .seek (0 )
681
681
# make sure we do not overwrite into an existing file
682
682
if hasattr (fp , 'truncate' ):
0 commit comments