@@ -219,11 +219,9 @@ def __init__(
219219 # Given how the tests are written, this seems more likely to catch Cygwin
220220 # git used from Windows than Windows git used from Cygwin. Therefore
221221 # changing to Cygwin-style paths is the relevant operation.
222- epath = cygpath (epath if isinstance ( epath , str ) else epath . __fspath__ ( ))
222+ epath = cygpath (os . fspath ( epath ))
223223
224- epath = epath or path or os .getcwd ()
225- if not isinstance (epath , str ):
226- epath = epath .__fspath__ ()
224+ epath = os .fspath (epath )
227225 if expand_vars and re .search (self .re_envvars , epath ):
228226 warnings .warn (
229227 "The use of environment variables in paths is deprecated"
@@ -1361,11 +1359,8 @@ def _clone(
13611359 ) -> "Repo" :
13621360 odbt = kwargs .pop ("odbt" , odb_default_type )
13631361
1364- # When pathlib.Path or other class-based path is passed
1365- if not isinstance (url , str ):
1366- url = url .__fspath__ ()
1367- if not isinstance (path , str ):
1368- path = path .__fspath__ ()
1362+ url = os .fspath (url )
1363+ path = os .fspath (path )
13691364
13701365 ## A bug win cygwin's Git, when `--bare` or `--separate-git-dir`
13711366 # it prepends the cwd or(?) the `url` into the `path, so::
0 commit comments