diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-25 14:47:37 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-25 14:47:37 (GMT) |
commit | f7a17b48d748e1835bcf9df86fb7fb318bb020f8 (patch) | |
tree | 403d91c57f72d6e538ce09a8037bd658bc619760 /Lib/argparse.py | |
parent | 16bdd4120d8452e8e04b124bcdd116608c5166b0 (diff) | |
download | cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.zip cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.tar.gz cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.tar.bz2 |
Replace IOError with OSError (#16715)
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 3b1a079..1c07110 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1167,7 +1167,7 @@ class FileType(object): try: return open(string, self._mode, self._bufsize, self._encoding, self._errors) - except IOError as e: + except OSError as e: message = _("can't open '%s': %s") raise ArgumentTypeError(message % (string, e)) @@ -2020,7 +2020,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): new_arg_strings.extend(arg_strings) finally: args_file.close() - except IOError: + except OSError: err = _sys.exc_info()[1] self.error(str(err)) |