softspace(): be prepared to catch AttributeError as well as TypeError

upon attempted attribute assignment.  Caught by MWH, SF bug #462522.
This commit is contained in:
Guido van Rossum 2001-09-18 13:33:01 +00:00
parent 22cd768177
commit 555d12f986
1 changed files with 2 additions and 1 deletions

View File

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