Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 555d12f

Browse files
committed
softspace(): be prepared to catch AttributeError as well as TypeError
upon attempted attribute assignment. Caught by MWH, SF bug #462522.
1 parent 22cd768 commit 555d12f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def softspace(file, newvalue):
2020
pass
2121
try:
2222
file.softspace = newvalue
23-
except TypeError: # "attribute-less object" or "read-only attributes"
23+
except (AttributeError, TypeError):
24+
# "attribute-less object" or "read-only attributes"
2425
pass
2526
return oldvalue
2627

0 commit comments

Comments
 (0)