summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/Lib/os.py b/Lib/os.py
index b967978..5824609 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -445,12 +445,17 @@ else:
def update(self, dict=None, **kwargs):
if dict:
try:
- items = dict.items()
+ keys = dict.keys()
except AttributeError:
# List of (key, value)
- items = dict
- for k, v in items:
- self[k] = v
+ for k, v in dict:
+ self[k] = v
+ else:
+ # got keys
+ # cannot use items(), since mappings
+ # may not have them.
+ for k in keys:
+ self[k] = dict[k]
if kwargs:
self.update(kwargs)
def copy(self):
@@ -467,12 +472,17 @@ else:
def update(self, dict=None, **kwargs):
if dict:
try:
- items = dict.items()
+ keys = dict.keys()
except AttributeError:
# List of (key, value)
- items = dict
- for k, v in items:
- self[k] = v
+ for k, v in dict:
+ self[k] = v
+ else:
+ # got keys
+ # cannot use items(), since mappings
+ # may not have them.
+ for k in keys:
+ self[k] = dict[k]
if kwargs:
self.update(kwargs)
try: