[Python-checkins] python/dist/src/Lib os.py,1.84,1.85
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Sat Jan 29 14:29:25 CET 2005
- Previous message: [Python-checkins]
python/dist/src/Lib/idlelib EditorWindow.py, 1.65,
1.66 NEWS.txt, 1.53, 1.54 config-keys.def, 1.21,
1.22 configHandler.py, 1.37, 1.38
- Next message: [Python-checkins] python/dist/src/Lib/test test_os.py,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6194/Lib
Modified Files:
os.py
Log Message:
Revert os.py 1.75, and directly implement update.
Fixes #1110478 and #1100235.
Index: os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- os.py 16 Jan 2005 08:40:57 -0000 1.84
+++ os.py 29 Jan 2005 13:29:22 -0000 1.85
@@ -442,6 +442,17 @@
return key.upper() in self.data
def get(self, key, failobj=None):
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):
return dict(self)
@@ -453,6 +464,17 @@
def __setitem__(self, key, item):
putenv(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:
unsetenv
except NameError:
- Previous message: [Python-checkins]
python/dist/src/Lib/idlelib EditorWindow.py, 1.65,
1.66 NEWS.txt, 1.53, 1.54 config-keys.def, 1.21,
1.22 configHandler.py, 1.37, 1.38
- Next message: [Python-checkins] python/dist/src/Lib/test test_os.py,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list