| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 59c3c80 commit 91d4cc5
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -634,7 +634,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 634 | 634 | self._read(file_path, file_path.name) | |
| 635 | 635 | else: | |
| 636 | 636 | # Assume a path if it is not a file-object. | |
| 637 | - file_path = cast(PathLike, file_path) | ||
| 637 | + file_path = os.fspath(file_path) | ||
| 638 | 638 | try: | |
| 639 | 639 | with open(file_path, "rb") as fp: | |
| 640 | 640 | file_ok = True | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -219,11 +219,9 @@ def __init__( | |||
| 219 | 219 | # Given how the tests are written, this seems more likely to catch Cygwin | |
| 220 | 220 | # git used from Windows than Windows git used from Cygwin. Therefore | |
| 221 | 221 | # 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)) | ||
| 223 | 223 | ||
| 224 | - epath = epath or path or os.getcwd() | ||
| 225 | - if not isinstance(epath, str): | ||
| 226 | - epath = epath.__fspath__() | ||
| 224 | + epath = os.fspath(epath) | ||
| 227 | 225 | if expand_vars and re.search(self.re_envvars, epath): | |
| 228 | 226 | warnings.warn( | |
| 229 | 227 | "The use of environment variables in paths is deprecated" | |
@@ -1361,11 +1359,8 @@ def _clone( | |||
| 1361 | 1359 | ) -> "Repo": | |
| 1362 | 1360 | odbt = kwargs.pop("odbt", odb_default_type) | |
| 1363 | 1361 | ||
| 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) | ||
| 1369 | 1364 | ||
| 1370 | 1365 | ## A bug win cygwin's Git, when `--bare` or `--separate-git-dir` | |
| 1371 | 1366 | # it prepends the cwd or(?) the `url` into the `path, so:: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments