fixed #1042 -- corrected an import #1043

Merged
merged 1 commit into from Jun 1, 2017
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Split
@@ -4,7 +4,7 @@
import platform
-import six
+from setuptools.extern import six
@fwdevmobile

fwdevmobile Jun 1, 2017

Why using six???

In package six the Python version is determined by calling sys.

PY2 = sys.version_info[0] == 2
See: https://bitbucket.org/gutworth/six/src/92e1c746e1abfbdb94705b821bc93766083efc54/six.py?at=default&fileviewer=file-view-default

Best solution is to use "sys" to check if it is python 2 version.

If it must be version 2.7 check for major and minor version!

@mosquito

mosquito Jun 1, 2017

actually reverting should looks better.

@fwdevmobile

fwdevmobile Jun 1, 2017

yes, reverting is a much cleaner solution.

@westsouthnight

westsouthnight Jun 1, 2017

all people still wait, if you can please revert this shortly

@The-Compiler

The-Compiler Jun 1, 2017

six is already used elsewhere, so it makes sense to use it here as well (after the import is corrected).

@westsouthnight This was worked around by pulling the affected version from PyPI, so things should be fine again for now.

@fwdevmobile

fwdevmobile Jun 1, 2017

I have seen that it was used in other parts to check if an object is of the type "isinstance(value, six.string_types)". Does that mean that this part of the code must have six? I just can't see that "import sys" must be replaced by six. It doesn't solve a problem in my opinion.

@The-Compiler

The-Compiler Jun 1, 2017

@fwdevmobile It doesn't mean it must have six. But it makes sense for it to use it when available, to - even if only for a tiny bit - increase readability and reduce technical debt. It's unfortunate that there was a mistake in it, but generally, it - IMHO - is a slight improvement.

@fwdevmobile

fwdevmobile Jun 1, 2017

I do agree with the new import will solve all deployment issues. Please merge.

from setuptools.extern import six
def get_all_headers(message, key):