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
5510f65f
Kaydet (Commit)
5510f65f
authored
Şub 17, 2005
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid using items() in environ.update(). Fixes #1124513.
Will backport to 2.4.
üst
3040b199
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
os.py
Lib/os.py
+18
-8
test_os.py
Lib/test/test_os.py
+1
-1
No files found.
Lib/os.py
Dosyayı görüntüle @
5510f65f
...
@@ -445,12 +445,17 @@ else:
...
@@ -445,12 +445,17 @@ else:
def
update
(
self
,
dict
=
None
,
**
kwargs
):
def
update
(
self
,
dict
=
None
,
**
kwargs
):
if
dict
:
if
dict
:
try
:
try
:
items
=
dict
.
item
s
()
keys
=
dict
.
key
s
()
except
AttributeError
:
except
AttributeError
:
# List of (key, value)
# List of (key, value)
items
=
dict
for
k
,
v
in
dict
:
for
k
,
v
in
items
:
self
[
k
]
=
v
self
[
k
]
=
v
else
:
# got keys
# cannot use items(), since mappings
# may not have them.
for
k
in
keys
:
self
[
k
]
=
dict
[
k
]
if
kwargs
:
if
kwargs
:
self
.
update
(
kwargs
)
self
.
update
(
kwargs
)
def
copy
(
self
):
def
copy
(
self
):
...
@@ -467,12 +472,17 @@ else:
...
@@ -467,12 +472,17 @@ else:
def
update
(
self
,
dict
=
None
,
**
kwargs
):
def
update
(
self
,
dict
=
None
,
**
kwargs
):
if
dict
:
if
dict
:
try
:
try
:
items
=
dict
.
item
s
()
keys
=
dict
.
key
s
()
except
AttributeError
:
except
AttributeError
:
# List of (key, value)
# List of (key, value)
items
=
dict
for
k
,
v
in
dict
:
for
k
,
v
in
items
:
self
[
k
]
=
v
self
[
k
]
=
v
else
:
# got keys
# cannot use items(), since mappings
# may not have them.
for
k
in
keys
:
self
[
k
]
=
dict
[
k
]
if
kwargs
:
if
kwargs
:
self
.
update
(
kwargs
)
self
.
update
(
kwargs
)
try
:
try
:
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
5510f65f
...
@@ -227,7 +227,7 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
...
@@ -227,7 +227,7 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
os
.
environ
.
update
(
self
.
__save
)
os
.
environ
.
update
(
self
.
__save
)
# Bug 1110478
# Bug 1110478
def
test_update
(
self
):
def
test_update
2
(
self
):
if
os
.
path
.
exists
(
"/bin/sh"
):
if
os
.
path
.
exists
(
"/bin/sh"
):
os
.
environ
.
update
(
HELLO
=
"World"
)
os
.
environ
.
update
(
HELLO
=
"World"
)
value
=
os
.
popen
(
"/bin/sh -c 'echo $HELLO'"
)
.
read
()
.
strip
()
value
=
os
.
popen
(
"/bin/sh -c 'echo $HELLO'"
)
.
read
()
.
strip
()
...
...
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