summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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