mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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:
parent
22cd768177
commit
555d12f986
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue