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
22fb839f
Kaydet (Commit)
22fb839f
authored
Eyl 28, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove imports of string when string methods will do.
üst
b64c2239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
posixpath.py
Lib/posixpath.py
+3
-5
No files found.
Lib/posixpath.py
Dosyayı görüntüle @
22fb839f
...
...
@@ -57,8 +57,7 @@ def join(a, *p):
def
split
(
p
):
"""Split a pathname. Returns tuple "(head, tail)" where "tail" is
everything after the final slash. Either part may be empty"""
import
string
i
=
string
.
rfind
(
p
,
'/'
)
+
1
i
=
p
.
rfind
(
'/'
)
+
1
head
,
tail
=
p
[:
i
],
p
[
i
:]
if
head
and
head
<>
'/'
*
len
(
head
):
while
head
[
-
1
]
==
'/'
:
...
...
@@ -344,9 +343,8 @@ def normpath(path):
"""Normalize path, eliminating double slashes, etc."""
if
path
==
''
:
return
'.'
import
string
initial_slash
=
(
path
[
0
]
==
'/'
)
comps
=
string
.
split
(
path
,
'/'
)
comps
=
path
.
split
(
'/'
)
new_comps
=
[]
for
comp
in
comps
:
if
comp
in
(
''
,
'.'
):
...
...
@@ -357,7 +355,7 @@ def normpath(path):
elif
new_comps
:
new_comps
.
pop
()
comps
=
new_comps
path
=
string
.
join
(
comps
,
'/'
)
path
=
'/'
.
join
(
comps
)
if
initial_slash
:
path
=
'/'
+
path
return
path
or
'.'
...
...
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