Skip to content

Instantly share code, notes, and snippets.

@peplin
Created March 19, 2015 12:42
Show Gist options
  • Save peplin/88ef5f26c4cc53160448 to your computer and use it in GitHub Desktop.
Save peplin/88ef5f26c4cc53160448 to your computer and use it in GitHub Desktop.
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