forked from benjaminp/six
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address OSError hierarchy Fixes benjaminp#311
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,11 @@ | |
import sys | ||
import types | ||
|
||
try: | ||
from select import error as select_error | ||
except ImportError: | ||
select_error = None | ||
|
||
__author__ = "Benjamin Peterson <[email protected]>" | ||
__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.""" | ||
|