diff options
author | Guido van Rossum <guido@python.org> | 2001-04-10 15:44:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-04-10 15:44:33 (GMT) |
commit | e9901f325e4bfb123479c706288d5c6a09bad406 (patch) | |
tree | 1d6ad5e501456a553638a389b3d7ea144393c8f0 /Lib/posixfile.py | |
parent | 6274fff287bb084f9511dd4c65c3898427f7c96d (diff) | |
download | cpython-e9901f325e4bfb123479c706288d5c6a09bad406.zip cpython-e9901f325e4bfb123479c706288d5c6a09bad406.tar.gz cpython-e9901f325e4bfb123479c706288d5c6a09bad406.tar.bz2 |
Fix two unqualified except: clauses.
This came out of SF bug #411881.
Diffstat (limited to 'Lib/posixfile.py')
-rw-r--r-- | Lib/posixfile.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/posixfile.py b/Lib/posixfile.py index 58c4b4f..1df0cc8 100644 --- a/Lib/posixfile.py +++ b/Lib/posixfile.py @@ -92,16 +92,16 @@ class _posixfile_: def dup(self): import posix - try: ignore = posix.fdopen - except: raise AttributeError, 'dup() method unavailable' + if not hasattr(posix, 'fdopen'): + raise AttributeError, 'dup() method unavailable' return posix.fdopen(posix.dup(self._file_.fileno()), self._file_.mode) def dup2(self, fd): import posix - try: ignore = posix.fdopen - except: raise AttributeError, 'dup() method unavailable' + if not hasattr(posix, 'fdopen'): + raise AttributeError, 'dup() method unavailable' posix.dup2(self._file_.fileno(), fd) return posix.fdopen(fd, self._file_.mode) |