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):
368368 If user or $HOME is unknown, do nothing."""
369369 path = os .fspath (path )
370370 if isinstance (path , bytes ):
371+ seps = b'\\ /'
371372 tilde = b'~'
372373 else :
374+ seps = '\\ /'
373375 tilde = '~'
374376 if not path .startswith (tilde ):
375377 return path
376378 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 :
378380 i += 1
379381
380382 if 'USERPROFILE' in os .environ :
Original file line number Diff line number Diff line change 44.. release date: 2024-04-09
55.. section: Core and Builtins
66
7- Improve performance of :func: `os.path.join `.
7+ Improve performance of :func: `os.path.join ` and :func: ` os.path.expanduser ` .
88
99..
1010
You can’t perform that action at this time.
0 commit comments