diff --git a/k8sclient/client/api_client.py b/k8sclient/client/api_client.py index dd7a62a..3cc60fb 100644 --- a/k8sclient/client/api_client.py +++ b/k8sclient/client/api_client.py @@ -40,6 +40,12 @@ from six.moves.urllib import parse as urlparse from .configuration import Configuration +if six.PY3: + import io + file_type = io.IOBase +else: + file_type = file + class ApiClient(object): """ @@ -185,7 +191,8 @@ class ApiClient(object): """ if isinstance(obj, type(None)): return None - elif isinstance(obj, (six.text_type, str, int, float, bool, tuple, file)): + elif isinstance(obj, (six.text_type, str, int, float, + bool, tuple, file_type)): return obj elif isinstance(obj, list): return [self.sanitize_for_serialization(sub_obj) diff --git a/requirements.txt b/requirements.txt index 30ad9ef..69027a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ # process, which may cause wedges in the gate later. pbr>=1.6 +six>=1.9.0 # MIT urllib3>=1.8.3 # MIT diff --git a/setup.cfg b/setup.cfg index 6a50556..3199e03 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,6 @@ classifier = Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 [files]