File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed 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
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
You can’t perform that action at this time.
0 commit comments