Bug #1287: make os.environ.pop() work as expected.

This commit is contained in:
Georg Brandl 2007-10-24 21:40:38 +00:00
parent 9afb9850f2
commit 1a94ec2664
3 changed files with 13 additions and 3 deletions

View file

@ -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)