Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
096c3ad4
Kaydet (Commit)
096c3ad4
authored
Şub 07, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make destinsrc private
üst
95f8ef28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
shutil.py
Lib/shutil.py
+2
-2
test_shutil.py
Lib/test/test_shutil.py
+4
-4
No files found.
Lib/shutil.py
Dosyayı görüntüle @
096c3ad4
...
@@ -256,7 +256,7 @@ def move(src, dst):
...
@@ -256,7 +256,7 @@ def move(src, dst):
os
.
rename
(
src
,
real_dst
)
os
.
rename
(
src
,
real_dst
)
except
OSError
:
except
OSError
:
if
os
.
path
.
isdir
(
src
):
if
os
.
path
.
isdir
(
src
):
if
destinsrc
(
src
,
dst
):
if
_
destinsrc
(
src
,
dst
):
raise
Error
,
"Cannot move a directory '
%
s' into itself '
%
s'."
%
(
src
,
dst
)
raise
Error
,
"Cannot move a directory '
%
s' into itself '
%
s'."
%
(
src
,
dst
)
copytree
(
src
,
real_dst
,
symlinks
=
True
)
copytree
(
src
,
real_dst
,
symlinks
=
True
)
rmtree
(
src
)
rmtree
(
src
)
...
@@ -264,7 +264,7 @@ def move(src, dst):
...
@@ -264,7 +264,7 @@ def move(src, dst):
copy2
(
src
,
real_dst
)
copy2
(
src
,
real_dst
)
os
.
unlink
(
src
)
os
.
unlink
(
src
)
def
destinsrc
(
src
,
dst
):
def
_
destinsrc
(
src
,
dst
):
src
=
abspath
(
src
)
src
=
abspath
(
src
)
dst
=
abspath
(
dst
)
dst
=
abspath
(
dst
)
if
not
src
.
endswith
(
os
.
path
.
sep
):
if
not
src
.
endswith
(
os
.
path
.
sep
):
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
096c3ad4
...
@@ -346,8 +346,8 @@ class TestMove(unittest.TestCase):
...
@@ -346,8 +346,8 @@ class TestMove(unittest.TestCase):
for
src
,
dst
in
[(
'srcdir'
,
'srcdir/dest'
)]:
for
src
,
dst
in
[(
'srcdir'
,
'srcdir/dest'
)]:
src
=
os
.
path
.
join
(
TESTFN
,
src
)
src
=
os
.
path
.
join
(
TESTFN
,
src
)
dst
=
os
.
path
.
join
(
TESTFN
,
dst
)
dst
=
os
.
path
.
join
(
TESTFN
,
dst
)
self
.
assert_
(
shutil
.
destinsrc
(
src
,
dst
),
self
.
assert_
(
shutil
.
_
destinsrc
(
src
,
dst
),
msg
=
'destinsrc() wrongly concluded that '
msg
=
'
_
destinsrc() wrongly concluded that '
'dst (
%
s) is not in src (
%
s)'
%
(
dst
,
src
))
'dst (
%
s) is not in src (
%
s)'
%
(
dst
,
src
))
finally
:
finally
:
shutil
.
rmtree
(
TESTFN
,
ignore_errors
=
True
)
shutil
.
rmtree
(
TESTFN
,
ignore_errors
=
True
)
...
@@ -358,8 +358,8 @@ class TestMove(unittest.TestCase):
...
@@ -358,8 +358,8 @@ class TestMove(unittest.TestCase):
for
src
,
dst
in
[(
'srcdir'
,
'src/dest'
),
(
'srcdir'
,
'srcdir.new'
)]:
for
src
,
dst
in
[(
'srcdir'
,
'src/dest'
),
(
'srcdir'
,
'srcdir.new'
)]:
src
=
os
.
path
.
join
(
TESTFN
,
src
)
src
=
os
.
path
.
join
(
TESTFN
,
src
)
dst
=
os
.
path
.
join
(
TESTFN
,
dst
)
dst
=
os
.
path
.
join
(
TESTFN
,
dst
)
self
.
failIf
(
shutil
.
destinsrc
(
src
,
dst
),
self
.
failIf
(
shutil
.
_
destinsrc
(
src
,
dst
),
msg
=
'destinsrc() wrongly concluded that '
msg
=
'
_
destinsrc() wrongly concluded that '
'dst (
%
s) is in src (
%
s)'
%
(
dst
,
src
))
'dst (
%
s) is in src (
%
s)'
%
(
dst
,
src
))
finally
:
finally
:
shutil
.
rmtree
(
TESTFN
,
ignore_errors
=
True
)
shutil
.
rmtree
(
TESTFN
,
ignore_errors
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment