Mercurial > cpython-lru_cache-weakref
diff Lib/code.py @ 19959:03f3ab0c7286 legacy-trunk
softspace(): be prepared to catch AttributeError as well as TypeError
upon attempted attribute assignment. Caught by MWH, SF bug #462522.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 18 Sep 2001 13:33:01 +0000 |
| parents | d5acff178ad5 |
| children | 906ad36cb7bc |
line wrap: on
line diff
--- a/Lib/code.py Tue Sep 18 05:40:24 2001 +0000 +++ b/Lib/code.py Tue Sep 18 13:33:01 2001 +0000 @@ -20,7 +20,8 @@ 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
