diff options
Diffstat (limited to 'Lib/_pyio.py')
| -rw-r--r-- | Lib/_pyio.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 3acbc65..1c194d5 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -775,7 +775,7 @@ class _BufferedIOMixin(BufferedIOBase): clsname = self.__class__.__name__ try: name = self.name - except AttributeError: + except Exception: return "<_pyio.{0}>".format(clsname) else: return "<_pyio.{0} name={1!r}>".format(clsname, name) @@ -1538,7 +1538,7 @@ class TextIOWrapper(TextIOBase): def __repr__(self): try: name = self.name - except AttributeError: + except Exception: return "<_pyio.TextIOWrapper encoding='{0}'>".format(self.encoding) else: return "<_pyio.TextIOWrapper name={0!r} encoding='{1}'>".format( |
