mirror of
https://github.com/python/cpython.git
synced 2025-08-11 20:40:27 +00:00
Backport fix for issue #10684 from 3.x
This commit is contained in:
parent
fe12aa67fc
commit
58d6b1b7a4
3 changed files with 28 additions and 0 deletions
|
@ -277,6 +277,12 @@ def move(src, dst):
|
|||
"""
|
||||
real_dst = dst
|
||||
if os.path.isdir(dst):
|
||||
if _samefile(src, dst):
|
||||
# We might be on a case insensitive filesystem,
|
||||
# perform the rename anyway.
|
||||
os.rename(src, dst)
|
||||
return
|
||||
|
||||
real_dst = os.path.join(dst, _basename(src))
|
||||
if os.path.exists(real_dst):
|
||||
raise Error, "Destination path '%s' already exists" % real_dst
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue