diff --git a/flake8/hooks.py b/flake8/hooks.py index 690aeed..6473c55 100644 --- a/flake8/hooks.py +++ b/flake8/hooks.py @@ -3,6 +3,12 @@ from __future__ import with_statement import os import sys from subprocess import Popen, PIPE +try: + # The 'demandimport' breaks pyflakes and flake8._pyflakes + from mercurial import demandimport + demandimport.disable() +except ImportError: + pass try: from configparser import ConfigParser except ImportError: # Python 2