Skip to content

Commit 8e42d91

Browse files
committedNov 25, 2019
address OSError hierarchy Fixes benjaminp#311
1 parent 33b584b commit 8e42d91

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎six.py

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
import sys
2929
import types
3030

31+
try:
32+
from select import error as select_error
33+
except ImportError:
34+
select_error = None
35+
3136
__author__ = "Benjamin Peterson <benjamin@python.org>"
3237
__version__ = "1.13.0"
3338

@@ -43,6 +48,7 @@
4348
class_types = type,
4449
text_type = str
4550
binary_type = bytes
51+
os_errors = OSError,
4652

4753
MAXSIZE = sys.maxsize
4854
else:
@@ -71,6 +77,12 @@ def __len__(self):
7177
MAXSIZE = int((1 << 63) - 1)
7278
del X
7379

80+
os_errors = (
81+
(EnvironmentError, select_error)
82+
if select_error
83+
else EnvironmentError,
84+
)
85+
7486

7587
def _add_doc(func, doc):
7688
"""Add documentation to a function."""

0 commit comments

Comments
 (0)
Please sign in to comment.