misplaced-future / W0410ΒΆ

Message emitted:

__future__ import is not the first non docstring statement

Description:

Python 2.5 and greater require __future__ import to be the first non docstring statement in the module.

Problematic code:

import sys

from __future__ import print_function  # [misplaced-future]

Correct code:

from __future__ import print_function

import sys

Additional details:

A bare raise statement will re-raise the last active exception in the current scope. If the raise statement is not in an except or finally block, a RuntimeError will be raised instead.

Created by the imports checker.