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
40f23e0d
Kaydet (Commit)
40f23e0d
authored
Kas 26, 2002
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Part of the fix for bug #410541: add ensure_relative() function
üst
96bc3b4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
dir_util.py
Lib/distutils/dir_util.py
+15
-1
No files found.
Lib/distutils/dir_util.py
Dosyayı görüntüle @
40f23e0d
...
...
@@ -6,7 +6,7 @@ Utility functions for manipulating directories and directory trees."""
__revision__
=
"$Id$"
import
os
import
os
,
sys
from
types
import
*
from
distutils.errors
import
DistutilsFileError
,
DistutilsInternalError
from
distutils
import
log
...
...
@@ -212,3 +212,17 @@ def remove_tree (directory, verbose=0, dry_run=0):
except
(
IOError
,
OSError
),
exc
:
log
.
warn
(
grok_environment_error
(
exc
,
"error removing
%
s: "
%
directory
))
def
ensure_relative
(
path
):
"""Take the full path 'path', and make it a relative path so
it can be the second argument to os.path.join().
"""
drive
,
path
=
os
.
path
.
splitdrive
(
path
)
if
sys
.
platform
==
'mac'
:
return
os
.
sep
+
path
else
:
if
path
[
0
:
1
]
==
os
.
sep
:
path
=
drive
+
path
[
1
:]
return
path
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