Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch conflicting, old version of `six`
import pyxb
# pyxb bundles an old version of the 'six' package (1.5.1) that is not compatible with
# werkzeug 0.10's auto-reloader. It was fixed in six 1.5.2, and the latest
# release is 1.9.0! We work around it by deleting the one problematic module
# that is added (winreg is only available on Windows, Tk on Linux).
import sys
import copy
del sys.modules['pyxb.utils.six.moves.winreg']
for module in copy.copy(sys.modules):
if module.startswith('pyxb.utils.six.moves.tkinter'):
del sys.modules[module]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment