| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -368,13 +368,15 @@ def expanduser(path): | |||
| 368 | 368 | If user or $HOME is unknown, do nothing.""" | |
| 369 | 369 | path = os.fspath(path) | |
| 370 | 370 | if isinstance(path, bytes): | |
| 371 | + seps = b'\\/' | ||
| 371 | 372 | tilde = b'~' | |
| 372 | 373 | else: | |
| 374 | + seps = '\\/' | ||
| 373 | 375 | tilde = '~' | |
| 374 | 376 | if not path.startswith(tilde): | |
| 375 | 377 | return path | |
| 376 | 378 | i, n = 1, len(path) | |
| 377 | - while i < n and path[i] not in _get_bothseps(path): | ||
| 379 | + while i < n and path[i] not in seps: | ||
| 378 | 380 | i += 1 | |
| 379 | 381 | ||
| 380 | 382 | if 'USERPROFILE' in os.environ: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | .. release date: 2024-04-09 | |
| 5 | 5 | .. section: Core and Builtins | |
| 6 | 6 | ||
| 7 | - Improve performance of :func:`os.path.join`. | ||
| 7 | + Improve performance of :func:`os.path.join` and :func:`os.path.expanduser`. | ||
| 8 | 8 | ||
| 9 | 9 | .. | |
| 10 | 10 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments