Pop first path from sys.path

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.
This commit is contained in:
ZyX 2014-09-16 23:59:11 +04:00
parent 849fef9b5a
commit 7f5c0d660d
1 changed files with 3 additions and 0 deletions

View File

@ -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: