mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Bug #1287: make os.environ.pop() work as expected.
This commit is contained in:
parent
9afb9850f2
commit
1a94ec2664
3 changed files with 13 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue