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
1d11de6d
Kaydet (Commit)
1d11de6d
authored
Ock 29, 2005
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert os.py 1.75, and directly implement update.
Fixes #1110478 and #1100235.
üst
3069dbb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
os.py
Lib/os.py
+22
-0
test_os.py
Lib/test/test_os.py
+7
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/os.py
Dosyayı görüntüle @
1d11de6d
...
@@ -442,6 +442,17 @@ else:
...
@@ -442,6 +442,17 @@ else:
return
key
.
upper
()
in
self
.
data
return
key
.
upper
()
in
self
.
data
def
get
(
self
,
key
,
failobj
=
None
):
def
get
(
self
,
key
,
failobj
=
None
):
return
self
.
data
.
get
(
key
.
upper
(),
failobj
)
return
self
.
data
.
get
(
key
.
upper
(),
failobj
)
def
update
(
self
,
dict
=
None
,
**
kwargs
):
if
dict
:
try
:
items
=
dict
.
items
()
except
AttributeError
:
# List of (key, value)
items
=
dict
for
k
,
v
in
items
:
self
[
k
]
=
v
if
kwargs
:
self
.
update
(
kwargs
)
def
copy
(
self
):
def
copy
(
self
):
return
dict
(
self
)
return
dict
(
self
)
...
@@ -453,6 +464,17 @@ else:
...
@@ -453,6 +464,17 @@ else:
def
__setitem__
(
self
,
key
,
item
):
def
__setitem__
(
self
,
key
,
item
):
putenv
(
key
,
item
)
putenv
(
key
,
item
)
self
.
data
[
key
]
=
item
self
.
data
[
key
]
=
item
def
update
(
self
,
dict
=
None
,
**
kwargs
):
if
dict
:
try
:
items
=
dict
.
items
()
except
AttributeError
:
# List of (key, value)
items
=
dict
for
k
,
v
in
items
:
self
[
k
]
=
v
if
kwargs
:
self
.
update
(
kwargs
)
try
:
try
:
unsetenv
unsetenv
except
NameError
:
except
NameError
:
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
1d11de6d
...
@@ -226,6 +226,13 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
...
@@ -226,6 +226,13 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
os
.
environ
.
clear
()
os
.
environ
.
clear
()
os
.
environ
.
update
(
self
.
__save
)
os
.
environ
.
update
(
self
.
__save
)
# Bug 1110478
def
test_update
(
self
):
if
os
.
path
.
exists
(
"/bin/sh"
):
os
.
environ
.
update
(
HELLO
=
"World"
)
value
=
os
.
popen
(
"/bin/sh -c 'echo $HELLO'"
)
.
read
()
.
strip
()
self
.
assertEquals
(
value
,
"World"
)
class
WalkTests
(
unittest
.
TestCase
):
class
WalkTests
(
unittest
.
TestCase
):
"""Tests for os.walk()."""
"""Tests for os.walk()."""
...
...
Misc/NEWS
Dosyayı görüntüle @
1d11de6d
...
@@ -45,6 +45,8 @@ Extension Modules
...
@@ -45,6 +45,8 @@ Extension Modules
Library
Library
-------
-------
- Bug #1110478: Revert os.environ.update to do putenv again.
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
...
...
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