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

View File

@ -20,7 +20,8 @@ def softspace(file, newvalue):
pass pass
try: try:
file.softspace = newvalue file.softspace = newvalue
except TypeError: # "attribute-less object" or "read-only attributes" except (AttributeError, TypeError):
# "attribute-less object" or "read-only attributes"
pass pass
return oldvalue return oldvalue