From ecc1f63a632337f8af5ccf0c26480dde09d80734 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sun, 10 Nov 2013 05:32:50 +0100 Subject: [PATCH] moved imports to the top --- waflib/ansiterm.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/waflib/ansiterm.py b/waflib/ansiterm.py index 022ca99e..ed02c680 100644 --- a/waflib/ansiterm.py +++ b/waflib/ansiterm.py @@ -1,4 +1,18 @@ -import sys, os +#!/usr/bin/env python +# encoding: utf-8 + +""" +Emulate a vt100 terminal in cmd.exe + +By wrapping sys.stdout / sys.stderr with Ansiterm, +the vt100 escape characters will be interpreted and +the equivalent actions will be performed with Win32 +console commands. + +""" + +import sys, os, re, threading + try: if not (sys.stderr.isatty() and sys.stdout.isatty()): raise ValueError('not a tty') @@ -26,8 +40,6 @@ try: except Exception: pass else: - import re, threading - is_vista = getattr(sys, "getwindowsversion", None) and sys.getwindowsversion()[0] >= 6 try: