From 7f5c0d660d85025b60492f4f712d8ecebc22e5ab Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 16 Sep 2014 23:59:11 +0400 Subject: [PATCH] Pop first path from sys.path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the `sys.path` documentation “As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter.” Since client is named `powerline.py` it tries to use the client itself as powerline module and obviously fails to import `lib` submodule. --- client/powerline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/powerline.py b/client/powerline.py index e2b77eaf..78403887 100755 --- a/client/powerline.py +++ b/client/powerline.py @@ -12,6 +12,9 @@ try: except ImportError: from os import environ +# XXX Hack for importing powerline modules to work. +sys.path.pop(0) + try: from powerline.lib.encoding import get_preferred_output_encoding except ImportError: