From 8e42d91e774e75e1732e2d09d0dd26bd6609b38e Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 25 Nov 2019 09:26:28 +0000 Subject: [PATCH] address OSError hierarchy Fixes #311 --- six.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/six.py b/six.py index d0aece89f..19e2efbcf 100644 --- a/six.py +++ b/six.py @@ -28,6 +28,11 @@ import sys import types +try: + from select import error as select_error +except ImportError: + select_error = None + __author__ = "Benjamin Peterson " __version__ = "1.13.0" @@ -43,6 +48,7 @@ class_types = type, text_type = str binary_type = bytes + os_errors = OSError, MAXSIZE = sys.maxsize else: @@ -71,6 +77,12 @@ def __len__(self): MAXSIZE = int((1 << 63) - 1) del X + os_errors = ( + (EnvironmentError, select_error) + if select_error + else EnvironmentError, + ) + def _add_doc(func, doc): """Add documentation to a function."""