summaryrefslogtreecommitdiffstats
path: root/Lib/code.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-18 13:33:01 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-18 13:33:01 (GMT)
commit555d12f986bbf422a98e9083fae266f5ec3550a7 (patch)
treec91dcd5dbf9c48ad3b6185c214aa8c358d83d67c /Lib/code.py
parent22cd7681777139a6c2409ea73cbcaf27fc2e5950 (diff)
downloadcpython-555d12f986bbf422a98e9083fae266f5ec3550a7.zip
cpython-555d12f986bbf422a98e9083fae266f5ec3550a7.tar.gz
cpython-555d12f986bbf422a98e9083fae266f5ec3550a7.tar.bz2
softspace(): be prepared to catch AttributeError as well as TypeError
upon attempted attribute assignment. Caught by MWH, SF bug #462522.
Diffstat (limited to 'Lib/code.py')
-rw-r--r--Lib/code.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/code.py b/Lib/code.py
index e2d5065..ad42a9b 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -20,7 +20,8 @@ def softspace(file, newvalue):
pass
try:
file.softspace = newvalue
- except TypeError: # "attribute-less object" or "read-only attributes"
+ except (AttributeError, TypeError):
+ # "attribute-less object" or "read-only attributes"
pass
return oldvalue