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
132fc540
Kaydet (Commit)
132fc540
authored
Agu 04, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove a dict.has_key() and list.sort(cmp=) usage from tarfile to silence
warnings under -3.
üst
cf297cd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tarfile.py
Lib/tarfile.py
+3
-2
No files found.
Lib/tarfile.py
Dosyayı görüntüle @
132fc540
...
@@ -51,6 +51,7 @@ import time
...
@@ -51,6 +51,7 @@ import time
import
struct
import
struct
import
copy
import
copy
import
re
import
re
import
operator
if
sys
.
platform
==
'mac'
:
if
sys
.
platform
==
'mac'
:
# This module needs work for MacOS9, especially in the area of pathname
# This module needs work for MacOS9, especially in the area of pathname
...
@@ -1401,7 +1402,7 @@ class TarInfo(object):
...
@@ -1401,7 +1402,7 @@ class TarInfo(object):
next
.
_apply_pax_info
(
pax_headers
,
tarfile
.
encoding
,
tarfile
.
errors
)
next
.
_apply_pax_info
(
pax_headers
,
tarfile
.
encoding
,
tarfile
.
errors
)
next
.
offset
=
self
.
offset
next
.
offset
=
self
.
offset
if
pax_headers
.
has_key
(
"size"
)
:
if
"size"
in
pax_headers
:
# If the extended header replaces the size field,
# If the extended header replaces the size field,
# we need to recalculate the offset where the next
# we need to recalculate the offset where the next
# header starts.
# header starts.
...
@@ -2027,7 +2028,7 @@ class TarFile(object):
...
@@ -2027,7 +2028,7 @@ class TarFile(object):
self
.
extract
(
tarinfo
,
path
)
self
.
extract
(
tarinfo
,
path
)
# Reverse sort directories.
# Reverse sort directories.
directories
.
sort
(
lambda
a
,
b
:
cmp
(
a
.
name
,
b
.
name
))
directories
.
sort
(
key
=
operator
.
attrgetter
(
'name'
))
directories
.
reverse
()
directories
.
reverse
()
# Set correct owner, mtime and filemode on directories.
# Set correct owner, mtime and filemode on directories.
...
...
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