pyflakes/pyflakes — pull request #7 by cngxzl (2013-04-15 03:21:48+00:00)
Title:  Fixed incompatibility issues with Mercurial

Mecurial's module "`demandimport`" delays imports form like "`import a, b.c`", cause Pyflakes was unable to distinguish Python 2 or 3. This patch changes the imports to immediate form "`__import__('a')`" to avoid this mechanism.

The bug can be	reappeared with Hghooks 0.5.5 (https://pypi.python.org/pypi/hghooks/). With the hook `pretxncommit.pyflakes = python:hghooks.code.pyflakeshook` enabled, trying to commit this `.py` file will fail:

``` python
# -*- coding: utf-8 -*-

class Foo(object)
bar = 1
```