If we can't find a .py file for the system six, use our bundled copy instead.

Fixes #32567
pull/30808/merge
Toshio Kuratomi 8 years ago
parent 2fb4f547a9
commit b77de1bd5d

@ -50,5 +50,12 @@ if _system_six:
six = _system_six
else:
from . import _six as six
six_py_file = '{0}.py'.format(os.path.splitext(six.__file__)[0])
if not os.path.exists(six_py_file):
# Only the .pyc/.pyo version of six was installed but we need a .py file
# Fallback to the bundled copy
from . import _six as six
six_py_file = '{0}.py'.format(os.path.splitext(six.__file__)[0])
exec(open(six_py_file, 'rb').read())

Loading…
Cancel
Save