summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-10-24 21:40:38 (GMT)
committerGeorg Brandl <georg@python.org>2007-10-24 21:40:38 (GMT)
commit1a94ec266483cf3212e362cb20ffb989e254ecf3 (patch)
tree47a318c659f0183114d2312c5f1ee746f7a73c44 /Lib
parent9afb9850f28519879fdadaa9467a7bdb46b01417 (diff)
downloadcpython-1a94ec266483cf3212e362cb20ffb989e254ecf3.zip
cpython-1a94ec266483cf3212e362cb20ffb989e254ecf3.tar.gz
cpython-1a94ec266483cf3212e362cb20ffb989e254ecf3.tar.bz2
Bug #1287: make os.environ.pop() work as expected.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/os.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 7d21763..ccc11f4 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -450,6 +450,9 @@ else:
for key in self.data.keys():
unsetenv(key)
del self.data[key]
+ def pop(self, key, *args):
+ unsetenv(key)
+ return self.data.pop(key, *args)
def has_key(self, key):
return key.upper() in self.data
def __contains__(self, key):
@@ -511,6 +514,9 @@ else:
for key in self.data.keys():
unsetenv(key)
del self.data[key]
+ def pop(self, key, *args):
+ unsetenv(key)
+ return self.data.pop(key, *args)
def copy(self):
return dict(self)